Last.fm Playcount Import (2010-03-28) [MM3/4]

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

Moderators: Peke, Gurus

cianoz
Posts: 15
Joined: Sat Sep 25, 2010 4:59 am

Re: Last.fm Playcount Import (2010-03-28) [MM3/4]

Post by cianoz »

Psyker7 wrote:Both of you try the latest 2.2 version
There may have been some issues when the directory for caching the xml files wasn't creating properly, this should fix that hopefully :)
Version 2.2 seems to work well.
Thank you
Spazz
Posts: 243
Joined: Tue Jan 11, 2005 9:49 pm

Re: Last.fm Playcount Import (2010-03-28) [MM3/4]

Post by Spazz »

Is there any way to automate the playcount //edit// beer and coherent posts do not mix //edit// and maybe only import only the last X day/hours/weeks/whatever? I'm in the process of refining a SubSonic server/mediamonkey/autoplaylist integration for my Droid X and play tracking is my last hurdle. If I could manage to automatically sync my Subsonic plays ( the server submits all plays to last.fm) I think I could relax my music anal retentiveness and completely immerse in my music again. I will have totally replaced itunes with playcount syncing.
Image
Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import (2010-03-28) [MM3/4]

Post by Psyker7 »

Spazz wrote:Is there any way to automate the playcount //edit// beer and coherent posts do not mix //edit// and maybe only import only the last X day/hours/weeks/whatever? I'm in the process of refining a SubSonic server/mediamonkey/autoplaylist integration for my Droid X and play tracking is my last hurdle. If I could manage to automatically sync my Subsonic plays ( the server submits all plays to last.fm) I think I could relax my music anal retentiveness and completely immerse in my music again. I will have totally replaced itunes with playcount syncing.
What the script actually does is makes sure the *total* playcounts match. It does cache the previous weeks data, so it's quick to run after the first go.

If your last.fm account already has comparable play counts to your library, then just make sure everything you play music from scrobbles it to last.fm and things will work fine. Unfortunately there will be a while before this will start working if your last.fm account was only created recently or if it's playcounts are well behind the databases.... I can't see an easy way to work around this.
markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Last.fm Playcount Import (2010-03-28) [MM3/4]

Post by markstuartwalker »

Hello Psyker

It is strange how some things come full circle. I'm looking to move to a Mac and so my d_itunes plugin is going to stop working. I have a future plan to export MM's playlists into a file structure of symbolic links which the Mac iTunes can read in (it can also feed my Ubuntu hosted Subsonic instance). This left me with a problem of what will come of the playcounts. I looked at various scripting solutions and then started looking at Last.fm and scrobbling.

And finally I bumped into your script ... the answer to my prayers!

When I get chance I'll give it a go on my test system :P
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
markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Last.fm Playcount Import (2010-03-28) [MM3/4]

Post by markstuartwalker »

Looking at the script coding I believe that you match the track based upon artist name and track title.

Does this work reliably? I deliberately changed my plugin away from name/title to use the MM database key to ensure that it was consistent.

Have you considered using some sort of fuzzy matching mechanism?
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
Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import (2010-03-28) [MM3/4]

Post by Psyker7 »

As we have no control over last.fm's databases we can't use any other matching mechanism than a simple Title & Artist. We can't even use Album unfortunately, so a limitation of this script is that it will update all tracks with the same title & artist across each album with that track.

The only time fuzzy matching would be of use is if you have changed track names since submitting a play to last.fm, or if last.fm has performed it's own mangling of your submitted tracks... I haven't come across any easy way to check if this has happened beyond simply trying some fuzzy stuff if it can't find a match from last.fm. To me that doesn't seem worth it as you could just as easily end up updating the wrong track that way.

Open to suggestions though!

======
Given you're exporting from MM into iTunes I'm not sure how my script is helpful anyway? It only does an *import* - it wouldn't touch iTunes database at all - something like this is probably more what you're after.
thirdprofile

Re: Last.fm Playcount Import (2010-03-28) [MM3/4]

Post by thirdprofile »

Hello

Is there a way I can export my plays from MM to iTunes so that I can use it as the middle man in exporting my last.fm play counts to iTunes?
Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import (2010-03-28) [MM3/4]

Post by Psyker7 »

thirdprofile wrote:Hello

Is there a way I can export my plays from MM to iTunes so that I can use it as the middle man in exporting my last.fm play counts to iTunes?
This script does not do an export I'm afraid, import only.
heartofhate
Posts: 190
Joined: Wed Jun 18, 2008 1:43 pm
Location: berlin

Re: Last.fm Playcount Import (2010-03-28) [MM3/4]

Post by heartofhate »

psyker7: thank you for this nice script. the idea is pretty awesome for database losses.

but i think the script has simply a bug about the playcounts: it makes no difference between studio- or live albums or bestofs.
i.e. if you have a song on two albums then the script won't differ between those songs. it will only give the higher playcount to both songs.
to make it more clear here is a specific example:
angel witch - white witch (album: angel witch) playcount: 73 (correct)
angel witch - white witch (album: burn the white witch (live)) playcount: 73 (not correct. should be 2)

are you still working on this script? since lastfm supports different albums it should be possible get this to work.
in musicbee the lastfm playcount import works like this already.
it would be really nice if you could accomplish it
Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import (2010-03-28) [MM3/4]

Post by Psyker7 »

heartofhate wrote:psyker7: thank you for this nice script. the idea is pretty awesome for database losses.

but i think the script has simply a bug about the playcounts: it makes no difference between studio- or live albums or bestofs.
i.e. if you have a song on two albums then the script won't differ between those songs. it will only give the higher playcount to both songs.
to make it more clear here is a specific example:
angel witch - white witch (album: angel witch) playcount: 73 (correct)
angel witch - white witch (album: burn the white witch (live)) playcount: 73 (not correct. should be 2)

are you still working on this script? since lastfm supports different albums it should be possible get this to work.
in musicbee the lastfm playcount import works like this already.
it would be really nice if you could accomplish it
There does not appear to be any way with the API to match previous plays with a particular album unfortunately.
An example of the output I'm parsing:
http://ws.audioscrobbler.com/2.0/?metho ... b7b2e0a026

As you can see, it doesn't have an album tag :( If you have a link tot he musicbee plugin I can have a look there to see how they achieve it.
heartofhate
Posts: 190
Joined: Wed Jun 18, 2008 1:43 pm
Location: berlin

Re: Last.fm Playcount Import (2010-03-28) [MM3/4]

Post by heartofhate »

actually it is not a plugin, it is a built-in feature of musicbee.
and there was the same answer about the API as you did but since 1.2.4068 it makes differences in the album.
here the changelog:
1.2.4068 Beta
- improved handling for last.fm playcount synch
- now includes album in the matching (before only artist and title could be matched, so leading to tracks on multiple albums all being updated)
- also updates the last-played date if the date on last.fm is at least an hour after the last-played date in your musicbee library
[...]
Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import (2010-03-28) [MM3/4]

Post by Psyker7 »

It appears as though they've added albums to the recent tracks played:
http://ws.audioscrobbler.com/2.0/?metho ... b7b2e0a026

This is what I was working on with version 3. I'll add in album support there sometime over the next week or two, but version 3 is a little buggy, particuarly if you're currently playing music, and I haven't put much time into it yet as caching these is more difficult, and it is needed, because otherwise for a history like mine of 30k+ plays it literally takes hours each time if you don't.

edit: seems they've also increased number of plays per page and added date ranges, so this will be *much* easier than it was before. I'll likely cache plays older than a week, while grabbing the current weeks plays on each run.
This means instant updates and Album matching should be coming in the next 2-3 weeks, schedule permitting :) I'll keep you all posted.
heartofhate
Posts: 190
Joined: Wed Jun 18, 2008 1:43 pm
Location: berlin

Re: Last.fm Playcount Import (2010-03-28) [MM3/4]

Post by heartofhate »

those are really good news. no need to hurry though
don't we want a bug-free product :P

i hope the import will go faster in the future though...for a 14k database it takes like forever (sorry for comparing it again do musicbee :x but... there it takes only 2mins. i really want to know what they did :evil: )
Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import (2010-03-28) [MM3/4]

Post by Psyker7 »

The first run is slow, subsequent runs are significantly faster.

It *may* be possible to load the xml asynchronously, but not using vbscript, I'd have to port it to c# or something, which I haven't tried with mediamonkey yet.
It's tempting because vbscript is a pain to code with sometimes.
markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Last.fm Playcount Import (2010-03-28) [MM3/4]

Post by markstuartwalker »

I'd suggest Delphi. I used it with my plugin and the linkage to MM is very good.
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
Post Reply