Export to iTunes

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Export to iTunes

Post by nynaevelan »

I am getting the following error, it's always on the same track:

Image
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Export to iTunes

Post by markstuartwalker »

nynaevelan wrote:I am getting the following error, it's always on the same track:

Image
I suspect that your MM database has been going longer than mine and has more entries. This is reading the ID index of tracks from the database which I cast to be an integer .... is yours above 16 bits? I expected VB integers are 32 bits but a quick test shows not.

The documentation at http://www.mediamonkey.com/wiki/index.php/Songs_table says INTEGER but I now consider that this merely means non-fractional.

The line at fault is

Code: Select all

mmID = cint(Iter.ValueByName( "ID" ))
As a patch can you edit the file and make the line

Code: Select all

mmID = clng(Iter.ValueByName( "ID" ))
If that works then I'll reissue 2.18.

Regards
Mark
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Export to iTunes

Post by nynaevelan »

That seems to have fixed the problem, now I have this one when selecting delete sync:

Image

Or this one with a clear sync:

Image

But I might be going somewhere wrong but I cannot figure out where. All I did was sync the playlist, then make some changes to it. When I try to delete the playlist I get the first error or when I try to clear the sync I get the second. I am only able to sync, the delete the data from the Options sheet in order to send the playlist to itunes as a fresh sync.

On a side note I am having trouble getting three tracks to show up in the playlist in itunes. They were added to MM yesterday, added to itunes today but they will not show up in the playlist in itunes, any ideas what I am doing wrong?
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Export to iTunes

Post by markstuartwalker »

I'm sorry, shoddy unit testing on my behalf. I was focussed on the SQL optimisation and didnt re-test the basic parts. Try 2.19.

Not sure about your 3 missing tracks. Switch on the debug mode in the options and see if anything comes out of the woodwork.

Mark
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Export to iTunes

Post by nynaevelan »

We are back in business and here is the info from the debug version for one of the tracks:

Image

Image
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Export to iTunes

Post by markstuartwalker »

The last debug output

Code: Select all

g.log.message "AddFile " & c.mmSongPath
Which is showing the file path for the track. Now the path is a combination of the SongPath and the Label from the Medias table.

Code: Select all

mmSongPath = cstr(Iter.ValueByName( "Label" ))&cstr(Iter.ValueByName( "SongPath" ))
Oddly this is showing it's drive letter as "Recovery:" where I'd usually expect to see "c:\" or similar. Why just these 3 should be doing this I do not know. Please check the database content if you can.

Mark

Update ...

I've found the problem ... I'm using the wrong column from the medias table. I habitually set the drive label to be the same as the drive letter so the code worked for me. The DRIVELETTER column holds an integer where 1 = "A". So the correct code to recover the complete songpath is:

Code: Select all

mmSongPath = chr( 65+Iter.ValueByName("DriveLetter" )) & cstr(Iter.ValueByName( "SongPath" ))
I've re-issued 2.19.

Mark
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Export to iTunes

Post by nynaevelan »

It's fixed and working now. :D BTW, is there a way to delete the copied playlist after the sync??
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Export to iTunes

Post by markstuartwalker »

nynaevelan wrote:It's fixed and working now. :D BTW, is there a way to delete the copied playlist after the sync??
I deliberately dont delete the playlist afterwards as can be reused again in the future. There is an additional lightweight check to see if the track count is the same, if it has changed then it regenerates.

If you find that it's "in the way" then move it into a sub-folder somewhere. Provided the name is unique then it will be found next time quite happily.

Mark
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Export to iTunes

Post by nynaevelan »

Ok, I didn't know it was checking for changes, I was manually deleting it after the syncs. But that is a good idea. :wink:
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
tmchow
Posts: 10
Joined: Fri Oct 30, 2009 1:15 am

Re: Export to iTunes

Post by tmchow »

I want to use iTunes as my primary music manager due to some integration scenarios I need, but will use MM for tag editing/management. MM currently only does iTunes ratings import after first-run, but never again after that. I need ratings in both places because I use both iTunes and Windows Media Center in my home and not having syncrhonized ratings is killing a bunch of scenarios for me.

I'm looking for a way to still rate everything in iTunes but periodically open up MM then have the ratings written out to POPM tags.

I was looking at building my own script for this, but was pointed to this script by another forum member. HOwever, I'm confused on how to use this script. I thought at first it was only used to export from MM to iTunes, but I recently read that it does both import AND export.

All that I want to do is copy ratings from iTunes to MM so MM writes out the POPM tags that Windows Media Player will read properly. Can someone tell me how this is done with this script? All I see are options for:

- Export selected playlists from MM to iTunes
- Delete selected playlists from iTunes
- Synchronize iTunes playlists and recover playcounts
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Export to iTunes

Post by nynaevelan »

What you'll need to do is:

1. create a playlist in MM of all the tracks in your db and use the Export selected playlists from MM to iTunes option.
2. When you want to update the ratings/playcounts in MM that you have changed from either MM, iTunes or your ipod use the Synchronize iTunes playlists and recover playcounts option.

Before doing this make sure you have enabled the option to sync playcounts and/or ratings.

In order to make my process easier to manage I created an autoplaylist in MM to identify tracks which have changed or been played in the last 5 days. However since iTunes will be your main program, you will need to figure out a way to get a subset of the affected tracks. But since the program is really fast it should have no trouble running on all your tracks and this will keep both databases in sync.
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Export to iTunes

Post by markstuartwalker »

Exactly right!

For clarification the initial design of the script was to export from MM into iTunes - mainly to sync the tracks to my iPhone (while the MM functionality was broken). I was later encouraged to expand the script to recover rating and playcounts back to MM and then further make it bidirectional.

The initial export will initialise the ratings and playcounts in iTunes to be the same as the MM values. Subsequent syncronisations equalises the ratings, playcounts and lastplayed date in each direction. The syncronisation is fast - about 6500 tracks in 30 seconds on my system.

The current code is stable and under freeze while I work out its conversion to be a proper MM device. MM devices are usually iPod, iRiver, USB memory sticks. Mine will be an iTunes instance. Watch this space!

Mark
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507
tmchow
Posts: 10
Joined: Fri Oct 30, 2009 1:15 am

Re: Export to iTunes

Post by tmchow »

markstuartwalker wrote:Exactly right!

For clarification the initial design of the script was to export from MM into iTunes - mainly to sync the tracks to my iPhone (while the MM functionality was broken). I was later encouraged to expand the script to recover rating and playcounts back to MM and then further make it bidirectional.

The initial export will initialise the ratings and playcounts in iTunes to be the same as the MM values. Subsequent syncronisations equalises the ratings, playcounts and lastplayed date in each direction. The syncronisation is fast - about 6500 tracks in 30 seconds on my system.

The current code is stable and under freeze while I work out its conversion to be a proper MM device. MM devices are usually iPod, iRiver, USB memory sticks. Mine will be an iTunes instance. Watch this space!

Mark
Can you confirm that the files WON'T be touched if the ratings are the same between MM and iTunes? I want to eliminate needless changes to the files so my file backups are still efficient/effective.
markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Export to iTunes

Post by markstuartwalker »

Rating and playlists are not stored in the (mp3) files. They are stored in the MM and iTunes databases.

I suggest that you backup both databases before starting and experiment with a few files to build your confidence.
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507
tmchow
Posts: 10
Joined: Fri Oct 30, 2009 1:15 am

Re: Export to iTunes

Post by tmchow »

markstuartwalker wrote:Rating and playlists are not stored in the (mp3) files. They are stored in the MM and iTunes databases.

I suggest that you backup both databases before starting and experiment with a few files to build your confidence.
huh? I know that iTunes stores ratings in it's XML but everything I've read says MM stores rating info in the POPM frame of ID3v2 tag.
Post Reply