How does one a base a podcast playlist off of release date

itunespodcasts

I'd like to be able to make a playlist that is all recently released podcasts.

Unfortunately release date is not a field available for selection in a smart playlist in iTunes.

Similar-ish dates like date added and modified date won't be close to release date when downloading the back-catalogue of newly added podcast.

The best solution I've come up with is to close itunes, truncate the iTunes Library.itl file, copy the release date field values in the iTunes Music Library.xml file into the date added field, and then relaunch iTunes, and letting it rebuild the itl file from the xml file.

However, my library file is large enough that the rebuild takes 20-30 min, and even with no hacking of the xml, fails more often than not.

Is there a method for me to either or both of:

  • hack the itl file to set the date added to the release date?
  • be able to select the release date either in rules for a smart playlist or the "limit to… selected by" dropdown of a smart playlist?

Best Answer

I'm not much of an AppleScripter, so this is modified from some scripts at Doug's AppleScripts website, but it's GPLed, so derivative works are allowed as long as they're also GPLed.

My idea was to make a script that could take the release date, which can't be used in smart playlists, and store it in the last skipped date, which can be used in smart playlists. If you just want to do this for podcasts (not for songs, for which you might actually use the last skipped field), just select your podcasts before running this script.

Once you do that, you can create a smart playlist selected on the "Last skipped" field to get the recently released podcasts.

enter image description here

So here we go:

 (*
 You can rename this script to whatever you want
 but please keep this information intact. Thanks.

 This program is free software released "as-is"; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

 Get a copy of the GNU General Public License by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

 or visit http://www.gnu.org/copyleft/gpl.html

 *)

 tell application "iTunes"
set sel to selection
if sel is not {} then
    set ofi to fixed indexing
    set fixed indexing to true
    repeat with thisTrack in sel
        set reld to release date of thisTrack
        tell thisTrack to set skipped date to reld
    end repeat
    set fixed indexing to ofi
else
    display dialog return & "Select some tracks first..." buttons {"Cancel"} default button 1 with icon 0 giving up after 15
    return
end if -- no sel    
 end tell