Export to iTunes library.xml

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Lowlander
Posts: 46003
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: Export to iTunes library.xml

Post by Lowlander » Fri Oct 19, 2018 6:38 pm

Why are you looking to export files? Are you looking to export specific metadata to iTunes?
Lowlander (MediaMonkey user since 2003)

Biggus_Dickus
Posts: 33
Joined: Tue Jun 26, 2018 12:46 am

Re: Export to iTunes library.xml

Post by Biggus_Dickus » Sat Oct 20, 2018 12:11 am

Hi Lowlander.
Yes and no. The reason is, I use a combination of Mediamonkey and Musicbee. Mediamonkey Gold for syncing my Android and MediaMonkey-Android-Pro for playback from my phone. But I prefer Musicbee for tagging and when I playback from my laptop, cause in my opinion, it has a better audio engine and is more configurable. MediaMonkey is great, while syncing back ratings and playcount/playdate. And MMA is great too, supporting multiple artists, genres. Musicbee isn't supported by android players. But Musicbee easily imports ratings made in Monkey, but not playcount/playdate. With importing iTunes.xml I can import playcount/playdate. But it imports playlist too, which already exists in Musicbee and are organized in folders. So I've everytime to delete the imported. It wouldn't be difficult, having only a few, but I've nearly 60 or so.

Teknojnky
Posts: 5533
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Re: Export to iTunes library.xml

Post by Teknojnky » Sun Oct 21, 2018 7:13 pm

just wanted to say thanks to all those keeping this script alive and working.

PLEX also utilizes itunes xml for playlist import, and its currently the only way to get MM playlists into plex.

So, traktor and musicbee users are not the only beneficiaries, but also plex users.

Teknojnky
Posts: 5533
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Re: Export to iTunes library.xml

Post by Teknojnky » Sun Oct 21, 2018 9:53 pm

hello again!

I have both a bug submission, and a feature request;

first the bug

this script generates invalid play date data for an unplayed track.

here is a real itunes xml output, there is no key for play date.

Code: Select all

		<key>7035</key>
		<dict>
			<key>Track ID</key><integer>7035</integer>
			<key>Size</key><integer>2748416</integer>
			<key>Total Time</key><integer>168803</integer>
			<key>Track Number</key><integer>13</integer>
			<key>Track Count</key><integer>17</integer>
			<key>Year</key><integer>1990</integer>
			<key>BPM</key><integer>134</integer>
			<key>Date Modified</key><date>2009-01-14T09:44:52Z</date>
			<key>Date Added</key><date>2018-10-22T02:16:03Z</date>
			<key>Bit Rate</key><integer>128</integer>
			<key>Sample Rate</key><integer>44100</integer>
			<key>Artwork Count</key><integer>1</integer>
			<key>Persistent ID</key><string>DD6E628FAB056EA5</string>
			<key>Track Type</key><string>File</string>
			<key>File Folder Count</key><integer>-1</integer>
			<key>Library Folder Count</key><integer>-1</integer>
			<key>Name</key><string>21st Century (Digital Boy)</string>
			<key>Artist</key><string>Bad Religion</string>
			<key>Album Artist</key><string>Bad Religion</string>
			<key>Album</key><string>Against the Grain</string>
			<key>Genre</key><string>Punk</string>
			<key>Kind</key><string>MPEG audio file</string>
			<key>Sort Artist</key><string>Bad Religion</string>
			<key>Location</key><string>file://localhost//sauron/media/audio/MP3/B/Bad%20Religion/1990%20-%20Against%20the%20Grain%20%5BMP3%5D/13%20-%20Bad%20Religion%20-%2021st%20Century%20(Digital%20Boy).mp3</string>
		</dict>

here is the script generated from mediamonkey for the same unplayed track (added dates will be different), with an invalid play date that is obviously in the past.

I confirmed in mediamonkey that there is no play date, and no play counts.

Code: Select all

        <key>39283</key>
        <dict>   
            <key>Track ID</key><integer>39283</integer>
            <key>Name</key><string>21st Century (Digital Boy)</string>
            <key>Artist</key><string>Bad Religion</string>
            <key>Album Artist</key><string>Bad Religion</string>
            <key>Album</key><string>Against the Grain</string>
            <key>Kind</key><string>MPEG audio file</string>
            <key>Size</key><integer>2748416</integer>
            <key>Genre</key><string>Punk</string>
            <key>Total Time</key><integer>168803</integer>
            <key>Track Number</key><integer>13</integer>
            <key>Rating</key><integer>50</integer>
            <key>Year</key><integer>1990</integer>
            <key>Date Modified</key><date>2009-01-14T03:44:52</date>
            <key>Date Added</key><date>2007-12-28T16:51:22</date>
 *           <key>Play Date UTC</key><date>1899-12-30T00:00:00</date>
            <key>Bit Rate</key><integer>128</integer>
            <key>Sample Rate</key><integer>44100</integer>
            <key>Track Type</key><string>File</string>
            <key>File Folder Count</key><integer>-1</integer>
            <key>Library Folder Count</key><integer>-1</integer>
            <key>BPM</key><string>134</string>
            <key>Location</key><string>file://localhost//sauron/media/audio/MP3/B/Bad%20Religion/1990%20-%20Against%20the%20Grain%20%5BMP3%5D/13%20-%20Bad%20Religion%20-%2021st%20Century%20(Digital%20Boy).mp3</string>
        </dict>

I raise this issue, due to the import to plex, it imports this invalid play date of the past, into the FUTURE in plex's database.

So there is actually 2 problems, 1 with the export script, and 1 with the plex import.

https://forums.plex.tv/t/plex-music-rec ... /319231/15


---


Ok for the feature request, I would like to suggest an option to modify the path (or more specifically, the drive) of the exported files.

for example, mediamonkey and itunes runs on windows, and the music files are on a network server.

the paths in both are \\sauron\media\audio\ and so on

Code: Select all

<key>Location</key><string>file://localhost//sauron/media/audio/MP3/B/Bad%20Religion/1990%20-%20Against%20the%20Grain%20%5BMP3%5D/13%20-%20Bad%20Religion%20-%2021st%20Century%20(Digital%20Boy).mp3</string>
plex however runs on that network server itself, so the path is local

Code: Select all

<key>Location</key><string>file://localhost/data/media/audio/MP3/B/Bad%20Religion/1990%20-%20Against%20the%20Grain%20%5BMP3%5D/13%20-%20Bad%20Religion%20-%2021st%20Century%20(Digital%20Boy).mp3</string>
while it's not difficult to do a find/replace, its an additional step I have to stop and do any time I want to update the xml for plex.

I have to replace the //sauron with /data

I would think this could be easy to do, since MM stores the drive and path separately.

I could probably go in the script and hardcode it, but I figure this might be useful for other users who have network stored music, which makes the path different from what itunes/mediamonkey see.

Biggus_Dickus
Posts: 33
Joined: Tue Jun 26, 2018 12:46 am

Re: Export to iTunes library.xml

Post by Biggus_Dickus » Mon Oct 22, 2018 10:48 am

Yes. I want to say thank you for this addon, also.
Does anybody know, where playlists begin and ends in xml file. So I could erase them manually. Thought I found start/end markers, but Musicbee gave me an error after importing all songs :-?

fvdpol
Posts: 27
Joined: Thu Aug 02, 2007 5:48 am
Location: The Netherlands

Re: Export to iTunes library.xml

Post by fvdpol » Wed Nov 14, 2018 2:10 pm

Teknojnky wrote:
Sun Oct 21, 2018 9:53 pm
I have both a bug submission, and a feature request;

first the bug

this script generates invalid play date data for an unplayed track.

<snip>

here is the script generated from mediamonkey for the same unplayed track (added dates will be different), with an invalid play date that is obviously in the past.

I confirmed in mediamonkey that there is no play date, and no play counts.


I raise this issue, due to the import to plex, it imports this invalid play date of the past, into the FUTURE in plex's database.
I'll have a look into this. I suspect this is actually already fixed in the current development version (available as source in GitHub; not released yet) as I fixed similar issue related to Serato import.

a pre-release version is included in the corresponding issue in GitHub, so if you want you can test that and provide feedback:
https://github.com/fvdpol/MM-ExportITun ... -431463505


Teknojnky wrote:
Sun Oct 21, 2018 9:53 pm

Ok for the feature request, I would like to suggest an option to modify the path (or more specifically, the drive) of the exported files.

for example, mediamonkey and itunes runs on windows, and the music files are on a network server.

the paths in both are \\sauron\media\audio\ and so on

Code: Select all

<key>Location</key><string>file://localhost//sauron/media/audio/MP3/B/Bad%20Religion/1990%20-%20Against%20the%20Grain%20%5BMP3%5D/13%20-%20Bad%20Religion%20-%2021st%20Century%20(Digital%20Boy).mp3</string>
plex however runs on that network server itself, so the path is local

Code: Select all

<key>Location</key><string>file://localhost/data/media/audio/MP3/B/Bad%20Religion/1990%20-%20Against%20the%20Grain%20%5BMP3%5D/13%20-%20Bad%20Religion%20-%2021st%20Century%20(Digital%20Boy).mp3</string>
while it's not difficult to do a find/replace, its an additional step I have to stop and do any time I want to update the xml for plex.

I have to replace the //sauron with /data

I would think this could be easy to do, since MM stores the drive and path separately.

I could probably go in the script and hardcode it, but I figure this might be useful for other users who have network stored music, which makes the path different from what itunes/mediamonkey see.
This is already available in the current release 1.6.2 (https://github.com/fvdpol/MM-ExportITun ... tag/v1.6.2), which was release 17 September. You should be able to configure both the path and filename for the iTunes library to be exported in the configuration dialog.
Please check which version of the add-on you are running.

see: https://github.com/fvdpol/MM-ExportITun ... figuration

fvdpol
Posts: 27
Joined: Thu Aug 02, 2007 5:48 am
Location: The Netherlands

Re: Export to iTunes library.xml

Post by fvdpol » Wed Nov 14, 2018 2:20 pm

Biggus_Dickus wrote:
Mon Oct 22, 2018 10:48 am
Yes. I want to say thank you for this addon, also.
Does anybody know, where playlists begin and ends in xml file. So I could erase them manually. Thought I found start/end markers, but Musicbee gave me an error after importing all songs :-?
The playlists are a separate section within the xml, so should be fairly easy to manually remove....

Initially I did not really understand your use-case for this feature, but now I do understand -- and is is completely different from my personal use-case since I use MediaMonkey to manage the playlists :-)

I logged your feature request in GitHub: https://github.com/fvdpol/MM-ExportITun ... /issues/12
please subscribe to this issue, discuss details en support me with testing once I start working on adding this feature.

Teknojnky
Posts: 5533
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Re: Export to iTunes library.xml

Post by Teknojnky » Wed Nov 14, 2018 2:45 pm

thanks I'll check it out!
fvdpol wrote:
Wed Nov 14, 2018 2:10 pm

This is already available in the current release 1.6.2 (https://github.com/fvdpol/MM-ExportITun ... tag/v1.6.2), which was release 17 September. You should be able to configure both the path and filename for the iTunes library to be exported in the configuration dialog.
Please check which version of the add-on you are running.

see: https://github.com/fvdpol/MM-ExportITun ... figuration
Not quite sure we are are on the same 'track' here.

Yes I see where I configure where itunes xml file can be saved at, but what I was asking about the path and drive of the media *inside* the xml.

in my example above, see how a music file changes the path from a remote to a local path (or vice versa in someone else's possible case).

fvdpol
Posts: 27
Joined: Thu Aug 02, 2007 5:48 am
Location: The Netherlands

Re: Export to iTunes library.xml

Post by fvdpol » Wed Nov 14, 2018 3:14 pm

Teknojnky wrote:
Wed Nov 14, 2018 2:45 pm
thanks I'll check it out!
fvdpol wrote:
Wed Nov 14, 2018 2:10 pm

This is already available in the current release 1.6.2 (https://github.com/fvdpol/MM-ExportITun ... tag/v1.6.2), which was release 17 September. You should be able to configure both the path and filename for the iTunes library to be exported in the configuration dialog.
Please check which version of the add-on you are running.

see: https://github.com/fvdpol/MM-ExportITun ... figuration
Not quite sure we are are on the same 'track' here.

Yes I see where I configure where itunes xml file can be saved at, but what I was asking about the path and drive of the media *inside* the xml.

in my example above, see how a music file changes the path from a remote to a local path (or vice versa in someone else's possible case).
Ok, got it! I indeed misread your issue, sorry about that.

Remapping of filepaths is not supported, and am currently not sure if this is something that I would envision within the scope of the MM add-on. Currently the file paths exported in the iTunes xml reference the location as seen by MediaMonkey (which can be a myriad of different locations/devices/folders... depending on how one manages their library)

I have a somewhat similar use-case myself where I export the library/playlists to iTunes format using this add-on; but use another application to perform a selective copy/synchronization of the part of the MM library (stored on my NAS) to local storage on my MacBook for Traktor DJ.

fvdpol
Posts: 27
Joined: Thu Aug 02, 2007 5:48 am
Location: The Netherlands

Re: Export to iTunes library.xml

Post by fvdpol » Fri Nov 16, 2018 9:42 am

fvdpol wrote:
Wed Nov 14, 2018 3:14 pm
Teknojnky wrote:
Wed Nov 14, 2018 2:45 pm
thanks I'll check it out!
fvdpol wrote:
Wed Nov 14, 2018 2:10 pm

This is already available in the current release 1.6.2 (https://github.com/fvdpol/MM-ExportITun ... tag/v1.6.2), which was release 17 September. You should be able to configure both the path and filename for the iTunes library to be exported in the configuration dialog.
Please check which version of the add-on you are running.

see: https://github.com/fvdpol/MM-ExportITun ... figuration
Not quite sure we are are on the same 'track' here.

Yes I see where I configure where itunes xml file can be saved at, but what I was asking about the path and drive of the media *inside* the xml.

in my example above, see how a music file changes the path from a remote to a local path (or vice versa in someone else's possible case).
Ok, got it! I indeed misread your issue, sorry about that.

Remapping of filepaths is not supported, and am currently not sure if this is something that I would envision within the scope of the MM add-on. Currently the file paths exported in the iTunes xml reference the location as seen by MediaMonkey (which can be a myriad of different locations/devices/folders... depending on how one manages their library)

I have a somewhat similar use-case myself where I export the library/playlists to iTunes format using this add-on; but use another application to perform a selective copy/synchronization of the part of the MM library (stored on my NAS) to local storage on my MacBook for Traktor DJ.

@Teknojnky, I created two issues in the GitHub Tracker:

https://github.com/fvdpol/MM-ExportITun ... /issues/13 -- invalid play date bug

https://github.com/fvdpol/MM-ExportITun ... /issues/14 -- file remapping feature request


Will perform some tests on the invalid play date bug, and document my analysis/findings in above issue.

For the file mapping feature request I want to have it (and discussion around it) clearly documented. Challenge I see is that if this add-on would support this feature it needs to do this in a proper/flexible/generic way usable for most cases; otherwise it is better to keep the add-on focused on it's primary task and make sure that is done properly. So I welcome your thoughts/ideas on how this could look like.


fvdpol
Posts: 27
Joined: Thu Aug 02, 2007 5:48 am
Location: The Netherlands

Re: Export to iTunes library.xml

Post by fvdpol » Fri Nov 16, 2018 11:47 am

fvdpol wrote:
Wed Nov 14, 2018 2:20 pm
Biggus_Dickus wrote:
Mon Oct 22, 2018 10:48 am
Yes. I want to say thank you for this addon, also.
Does anybody know, where playlists begin and ends in xml file. So I could erase them manually. Thought I found start/end markers, but Musicbee gave me an error after importing all songs :-?
The playlists are a separate section within the xml, so should be fairly easy to manually remove....

Initially I did not really understand your use-case for this feature, but now I do understand -- and is is completely different from my personal use-case since I use MediaMonkey to manage the playlists :-)

I logged your feature request in GitHub: https://github.com/fvdpol/MM-ExportITun ... /issues/12
please subscribe to this issue, discuss details en support me with testing once I start working on adding this feature.
Added this feature to the current development version in the 'exclude-playlists-in-export' branch, and tagged it for potential inclusion for the next release.
I added a build of add-on with this new feature to the GitHub issue https://github.com/fvdpol/MM-ExportITun ... /issues/12

Please check with this works for you / is what you are looking for and let me know (preferably as comment on the GitHub issue as that is much easier to keep track of than this forum)

fvdpol
Posts: 27
Joined: Thu Aug 02, 2007 5:48 am
Location: The Netherlands

Export to iTunes library.xml version 1.6.3 release

Post by fvdpol » Fri Nov 16, 2018 11:54 am

New version of the Export to iTunes Library.xml add-on has been released today:

Version 1.6.3 - Serato & Pioneer Recordbox DJ Compatibility
  • reorder xml fields to (better) match iTunes format
  • add Persistent ID for compatibility with Serato DJ
  • add Grouping in export
  • add dummy Library Persistent ID to the header for compatibility with Pioneer Recordbox DJ
  • mark playlists that have sub-playlists as 'folder' (for compatibility with Pioneer Recordbox DJ)
  • add "Play Date" (timestamp in numeric format) in addition to the "Play Date UTC"
This release resolves issues #10, #11, #13


Available on: https://github.com/fvdpol/MM-ExportITun ... tag/v1.6.3

or use MediaMonkey Tools->Extensions->Find Updates to update the ExportITunesXML script.


(I also updated the add-on on the MediaMonkey add-on repository, may take a few more days till the moderator approves this.)

Peke
Posts: 12293
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia
Contact:

Re: Export to iTunes library.xml

Post by Peke » Fri Nov 16, 2018 6:23 pm

Validated!
Best regards,
Pavle
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
How to add SCREENSHOTS to forum

Biggus_Dickus
Posts: 33
Joined: Tue Jun 26, 2018 12:46 am

Re: Export to iTunes library.xml

Post by Biggus_Dickus » Sat Nov 17, 2018 2:00 am

Thx a lot. Will try this Weekend!
fvdpol wrote:
Fri Nov 16, 2018 11:47 am
fvdpol wrote:
Wed Nov 14, 2018 2:20 pm
Biggus_Dickus wrote:
Mon Oct 22, 2018 10:48 am
Yes. I want to say thank you for this addon, also.
Does anybody know, where playlists begin and ends in xml file. So I could erase them manually. Thought I found start/end markers, but Musicbee gave me an error after importing all songs :-?
The playlists are a separate section within the xml, so should be fairly easy to manually remove....

Initially I did not really understand your use-case for this feature, but now I do understand -- and is is completely different from my personal use-case since I use MediaMonkey to manage the playlists :-)

I logged your feature request in GitHub: https://github.com/fvdpol/MM-ExportITun ... /issues/12
please subscribe to this issue, discuss details en support me with testing once I start working on adding this feature.
Added this feature to the current development version in the 'exclude-playlists-in-export' branch, and tagged it for potential inclusion for the next release.
I added a build of add-on with this new feature to the GitHub issue https://github.com/fvdpol/MM-ExportITun ... /issues/12

Please check with this works for you / is what you are looking for and let me know (preferably as comment on the GitHub issue as that is much easier to keep track of than this forum)

Post Reply