Importing playlists from iTunes - a work in progress

Server Version#: 1.24.4.5081
Player Version#: n/a

Hi all. There are a couple of good existing threads on iTunes importing (have a look at this one with lots of useful pointers from @trumpy81). Based on those, it seems the most recent versions have included some updates/improvements to iTunes importing so I thought I’d have a go!

My main reason for doing this is to be able to access my music and playlists while away from home using mobile devices. At home my Sonos hoovers up my iTunes library quite neatly so that’s covered.

A few key pointers/baseline for all…

  • I’m doing this on a Synology DS920+ running DSM 6.2
  • My iTunes is on Windoze 10 with all my files (media and indexes) at /volume1/iTunes
  • So my music is in /volume1/iTunes/iTunes Music
  • That folder has been added to my music library in Plex and all the tracks and albums loaded nicely
  • My iTunes Library file is at /volume1/iTunes/iTunes Music Library.xml
  • I’m creating an updated version for use in the Plex Plugins page at /volume1/iTunes/iTunes Music Library for Plex.xml
  • I’ve created that file using a simple sed script to replace file://localhost//hostname with file://localhost/volume1
  • I created a simple playlist manually in Plex to make the Playlists navigation - that allowed me to access the Import from iTunes… button

The good news is that it all mostly worked!

  • The ratings loaded
  • All my manual playlists loaded
  • All iTunes Genius playlists loaded
  • Empty playlists were skipped

The one (expected) disappointment is that the smart playlists didn’t load. In the log file for each one i reads…

DEBUG - iTunes importer: playlist 'Best of David Bowie' (smart: 1)
DEBUG - Added new metadata item (Best of David Bowie) with ID 56832
WARN - iTunes importer: unable to parse the smart playlist.
ERROR - iTunes importer: Couldn't import playlist Best of David Bowie, deleting.
DEBUG - Destroying metadata item 56832 (Best of David Bowie)

So I’m curious about why smart playlists are being treated differently than if there’s anything I can do to get them to import as flat playlists.

A flat playlist in the XML looks like this…

	<dict>
		<key>Playlist ID</key><integer>127436</integer>
		<key>Parent Persistent ID</key><string>D9841A80B3779444</string>
		<key>Playlist Persistent ID</key><string>2DCFC00235009CB7</string>
		<key>All Items</key><true/>
		<key>Name</key><string>Mullet Music</string>
		<key>Playlist Items</key>
		<array>
			<dict>
				<key>Track ID</key><integer>8908</integer>
			</dict>
			<dict>
				<key>Track ID</key><integer>8910</integer>
			</dict>
			...
		</array>
	</dict>

And a smart playlist looks like this…

	<dict>
		<key>Playlist ID</key><integer>112462</integer>
		<key>Parent Persistent ID</key><string>1A298E802320D10F</string>
		<key>Playlist Persistent ID</key><string>DEE09D89DAAD9A25</string>
		<key>All Items</key><true/>
		<key>Name</key><string>Best of David Bowie</string>
		<key>Smart Info</key>
		<data>AQEA....</data>
		<key>Smart Criteria</key>
		<data>U0xzd............</data>
		<key>Playlist Items</key>
		<array>
			<dict>
				<key>Track ID</key><integer>34554</integer>
			</dict>
			<dict>
				<key>Track ID</key><integer>34556</integer>
			</dict>
			...
		</array>
	</dict>

So to these untrained eyes, it looks like these are identical except for the references to Smart Info and Smart Criteria.

Is it reasonable to think that it might be possible to remove these tags and then successfully load the smart playlists as normal dumb playlists?
Has anyone tried it?
Thoughts and feedback welcome!

Thanks
Mark

Yes, 100%. I read, believed, and took advice! So had low expectations for any of my smart playlists loading as many of them use nested and/or constructs. And thanks for the link!

But as I said, I still wanted to have a go just to see…
And I’m pleased that the smart playlists failed so cleanly.

What I’m interested in trying now is to see if I can import the smart playlists as dumb ones by removing those tags. And then I may try recreating my smart playlists in Plex. But I have sooooo many of them!

M

In my smart playlists (shown above and below) there’s a materialised list of the actual tracks in the list. So I’m figuring if I remove those keys and data elements, it might just load them as dumb lists?

	<key>Name</key><string>Best of David Bowie</string>
	<key>Smart Info</key>
	<data>AQEA....</data>
	<key>Smart Criteria</key>
	<data>U0xzd............</data>
	<key>Playlist Items</key>
	<array>
		<dict>
			<key>Track ID</key><integer>34554</integer>
		</dict>
		<dict>
			<key>Track ID</key><integer>34556</integer>
		</dict>
		...
	</array>

I just included 2 tracks for brevity above (hence the …). All the tracks are listed in the <array> element so I suspect that I can import them as dumb playlists.

But yes, I’ll try it both ways and see where I get to!
I’ll test and return…

M

Intriguing. Thanks for sharing. :+1:t3:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.