Author Topic: iTunes xml export - no error when export fails due to duplicate playlist names  (Read 2936 times)

alec.tron

  • Sr. Member
  • ****
  • Posts: 752
Heya,
I've mentioned this before in one of the many iTunes threads but I can't find it anymore...

So, as this is still around and is a bug imo:
- if you have playlists in folders/groups
AND
- anywhere in your hierarchy of folders & playlists there happens to be the same name for 2 playlists
=
MusicBee will quietly stop writing/updating the
iTunes Music Library.xml
file.

If MB is not able to execute a functionality, it should inform the user imo that it did fail on said function, and MB does so on every occasion I have encountered but this...
Would be grand to have MB error visibly in this case as well if it can not write files it is meant to write/update.

Cheers.
c.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
I cant see why having the same playlist name in different folders would matter. There would be an error in the error log around the time the iTunes file is being created eg. when you shut down MB. Could you send me that text?

Perhaps its the system loading the file that cant handle the same playlist names?
Last Edit: January 07, 2018, 10:41:55 AM by Steven

alec.tron

  • Sr. Member
  • ****
  • Posts: 752
Hey,
I removed the offending dupliocated playlist name then (I had an auto-playlist for a ghnre and a mood with the same name...), and when looking for errors actively inside the error logs, there was nothing to be seen unfortunately.
I'll create a new duplicate playlist now and do the above and will send through the error log in a bit.

But, I would assume the problem with this is bi-fold - i.e. one issue with iTunes xml export was that MB does not keep the folder structure, and one ends up with a long list of playlists in the root of the iTunes playlist node:
https://getmusicbee.com/forum/index.php?topic=20080.0
So duplicate names would cause an issue there, just unfortunate that this issue/error, if it happens can't be seen, other than the outcome, i.e. that the xml is not written.

Churs.
c.

alec.tron

  • Sr. Member
  • ****
  • Posts: 752
Heh... this is funny.
Now I've recreated the same, (with the latest MB 3.2 though...) and now the iTunes xml gets written out, and I can see the duplicate playlist name in the xml (now I'm curious what other apps trying to import/parse this are dealing with this):


Code
 <dict>
 <key>Name</key><string>Slow</string>
 <key>Playlist ID</key><integer>36106</integer>
 <key>Playlist Persistent ID</key><string>7D0DAEAAB8178CD1</string>
 <key>All Items</key><true/>
 <key>Playlist Items</key>
 <array>
...
 <dict>
 <key>Name</key><string>Slow</string>
 <key>Playlist ID</key><integer>36071</integer>
 <key>Playlist Persistent ID</key><string>921A1547B8178CD1</string>
 <key>All Items</key><true/>
 <key>Playlist Items</key>
 <dict>

Whereas before - when the iTunes xml file export completely stopped, the fix was to remove one of the 'Slow' playlists, either from my
[AutoPlaylists]
  • Genres

or
  • Moods

folders in MB, and the iTUnes xml export would magically start working again...

Has anything changed on the recent patched version ?

Churs.
c.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
there is no reason for duplicate filenames to cause MB to fail exporting.
However, i was just playing around with this and MB wont update the iTunes file if the only thing you do is add/remove files from a playlist so i will look to fix that

alec.tron

  • Sr. Member
  • ****
  • Posts: 752
Thanks!

Also, any chance, while poking around the iTunes bits, to take a peek if the users suggestion here is true and it's an easy fix to have the iTunes xml have the same folder/playlist structure as it is in musicBee ?

+1 here! ;)

I tink that folder and file structure in playlists disappears because the correct XML tags aren't in the exported file. Tag (<key>Folder</key><true/> in the playlist parent folder and <key>Parent Persistent ID</key><string>parent folder ID</string> in the son playlist)

Churs.
c.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313

alec.tron

  • Sr. Member
  • ****
  • Posts: 752
Thanks a lot! That's awesome!

I tested a new MB generated  iTunes xml with the above patch in my target software right away as this got me rather excited, i.e. Serato SSL / Scratch 2.5, SDJ Pro 2 Beta, Rekordbox, Traktor 2....
But unfortunately that fix has introduced a few issues on all of them and the xml is not useable as is for neither of them (empty playlists, erratic consistency/missing entries/files & iTunes playlists pop up all over the place now [usually they are contained in an 'iTunes' node in all of them that can be expanded, looks like the empty playlists that just act as parents are to blame here...])

So I had a look around and installed an older iTunes 10 version on an old pc to see what might be amiss, and from what I can see, one little step is missing still. i.e. this is what an iTunes generated xml with nested/parented playlists looks like:

Code
<dict>
            <key>Name</key><string>iTunesPlaylistStaticGroup</string>
            <key>Playlist ID</key><integer>171</integer>
            <key>Playlist Persistent ID</key><string>4A91BFFA25BC6435</string>
            <key>All Items</key><true/>
            <key>Folder</key><true/>
            <key>Playlist Items</key>
            <array>
                <dict>
                    <key>Track ID</key><integer>76</integer>
                </dict>
                <dict>
                    <key>Track ID</key><integer>78</integer>
                </dict>
                <dict>
                    <key>Track ID</key><integer>284</integer>
                </dict>
                <dict>
                    <key>Track ID</key><integer>276</integer>
                </dict>
                <dict>
                    <key>Track ID</key><integer>80</integer>
                </dict>
                <dict>
                    <key>Track ID</key><integer>281</integer>
                </dict>
            </array>
        </dict>
        <dict>
            <key>Name</key><string>iTunesPlaylistStaticGrouped1</string>
            <key>Playlist ID</key><integer>177</integer>
            <key>Playlist Persistent ID</key><string>FBCF922FE783DB99</string>
            <key>Parent Persistent ID</key><string>4A91BFFA25BC6435</string>
            <key>All Items</key><true/>
            <key>Playlist Items</key>
            <array>
                <dict>
                    <key>Track ID</key><integer>80</integer>
                </dict>
                <dict>
                    <key>Track ID</key><integer>76</integer>
                </dict>
                <dict>
                    <key>Track ID</key><integer>78</integer>
                </dict>
            </array>
        </dict>
        <dict>
            <key>Name</key><string>iTunesPlaylistStaticGrouped2</string>
            <key>Playlist ID</key><integer>300</integer>
            <key>Playlist Persistent ID</key><string>C5A498A0298059DB</string>
            <key>Parent Persistent ID</key><string>4A91BFFA25BC6435</string>
            <key>All Items</key><true/>
            <key>Playlist Items</key>
            <array>
                <dict>
                    <key>Track ID</key><integer>284</integer>
                </dict>
                <dict>
                    <key>Track ID</key><integer>281</integer>
                </dict>
                <dict>
                    <key>Track ID</key><integer>276</integer>
                </dict>
            </array>
        </dict>

And 2 unparented ones of the same:
Code
        <dict>
            <key>Name</key><string>iTunesPlaylistStatic1</string>
            <key>Playlist ID</key><integer>165</integer>
            <key>Playlist Persistent ID</key><string>F82339FC6F0069EF</string>
            <key>All Items</key><true/>
            <key>Playlist Items</key>
            <array>
                <dict>
                    <key>Track ID</key><integer>78</integer>
                </dict>
                <dict>
                    <key>Track ID</key><integer>80</integer>
                </dict>
                <dict>
                    <key>Track ID</key><integer>76</integer>
                </dict>
            </array>
        </dict>
        <dict>
            <key>Name</key><string>iTunesPlaylistStatic2</string>
            <key>Playlist ID</key><integer>245</integer>
            <key>Playlist Persistent ID</key><string>4AA0360DE815561F</string>
            <key>All Items</key><true/>
            <key>Playlist Items</key>
            <array>
                <dict>
                    <key>Track ID</key><integer>276</integer>
                </dict>
                <dict>
                    <key>Track ID</key><integer>284</integer>
                </dict>
                <dict>
                    <key>Track ID</key><integer>281</integer>
                </dict>
            </array>
        </dict>


So looks like the parent declared in
<key>Parent Persistent ID</key>
needs to recursively hold references ('Track ID') to ALL of its' child playlists contents ('Track ID') as it looks.


What do you reckon  / what's best here for you - revert to the previous state, which mostly worked bar not having the parent folders, or add the feature to populate the parent playlist as per how apple/itunes does it themselves ?



Also, while on the topic of itunes xml & playlists - and feel free to ignore this... { I can relate, I get angry having to deal with the itunes rubbish, unfortunately the above Dj software bits are all equally useless when it comes to internal library & playlist management (no multi value metadata support, only very basic smart playlists, no access to many standard as well as custom metadata frames [i.e. some trivia - Serato hasn't managed to support the POPM field... despite it being requested by thousands of people every year still... since 2004 ish...]) }


But the last little annoyance with MB & iTunes I have to work around on a weekly basis (when exporting the xml to the target app):
Is there a way to push a specific sorting for smart-playlists into the resulting iTunes playlist sorting ?
As is, static playlist come through fine via ''natural sorting' (so I am using this work around: https://getmusicbee.com/forum/index.php?topic=20764.msg127533#msg127533 )
but smart-playlists -> itunes playlist always end up being sorted sequentially by iTunes'
<key>Track ID</key><integer>1</integer>
which never has anything to do with the sorting one might actually be after or what is switched on as the active sorting (which seems to be the trigger for static playlist exports that I shoe-horn for this)...
So if you can think of an easy way to push MB's active sorting for smart-playlist/s to the respective iTunes xmls playlist/s, that would be rather awesome!

Cheerio.
c.
Last Edit: January 14, 2018, 04:35:22 AM by alec.tron

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313