Smart playlists are too smart for iTunes Match

30 Jun 2015 21:07 | apple

This has been driving me nuts for months and I finally figured it out - smart
playlists break iTunes Match.

I have a smart playlist simply called "Music" which is configured as:

Match all of:<br/>
 - Media kind is "Music"<br/>
 - Genre is not "Audiobooks"<br/> No limit<br/> No "match only ticked
   items"<br/> Live updating enabled<br/><br/>

This is intended to always contain all my songs and for the most part it does
exactly that.  However, after restoring my iPhone 5S, enabling iTunes Match and
attempting to download this playlist (i.e, all my music..) it starts to
download the songs but then starts adding hundreds of my deleted songs back
into iTunes, and thus back into the smart playlist itself.

My previous workaround was to simply disable iTunes Match, sync the songs
manually from my mac and then re-enable it again, but if you're doing that you
have to wonder what the point of paying for the service is.

Anyway, today whilst installing the 8.4 release I finally made some progress
and figured out that it's something to do with the smart playlist.  If I put
all my (non-deleted) music into a regular playlist and download that right
after a restore, it works exactly as it should.  So it seems that there's some
kind of bug in the way smart playlists are handled - they work fine for the
most part until you try to download an entire one on an iDevice.

What's also interesting is that when this starts happening, if I turn off the
iPhone it stops straight away, no more deleted songs will appear in iTunes so
it seems to be specific to some API that the iPhone is calling in order to
download all the songs.

My best guess is that the API the iPhone calls in order to determine which
tracks are in a smart playlist doesn't by default exclude songs that have been
previously deleted.  As it's then downloading all the deleted songs on the
iPhone, iTunes Match interprets this as a willful re-download of the song by me
and then undeletes it.

Unfortunately there isn't an obvious way I can see to configure the smart
playlist to explictly exclude deleted songs.  It has an "iCloud Status" field,
but it's not possible to have a multi-part OR condition alongside two other AND
conditions so I can't really do it.  I think what you'd need is:

Media kind is "Music" AND Genre is not "Audiobooks" AND ( iCloud Status is
"Matched" or iCloud Status is "Uploaded" or iCloud Status is "Purchased" )

Of course the best solution would be for Apple to just fix their broken API.
I've submitted this as bug report #21617107, fingers crossed someone will pick
it up and fix it.  Until then I'll have to stick to a dumb playlist for my "all
music" list.