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

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Funkafonik
Posts: 58
Joined: Fri Feb 13, 2009 12:33 pm

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

Post by Funkafonik » Tue May 29, 2012 12:42 pm

julianfarr wrote:
1. I have quite a few instances of songs in my database which are on more than one album (especially where I have a somg on its original album, and then the same song on a compilation album) - I felt that the play count should only be updated on the album which was actually played.

Jules
What happens to all the songs without/mismatching album tags?
Would it be possible to give options on which album to put these "leftovers/mismatching" scrobbles?

Can't wait for that update, thanks a lot for working on this! :)

Julianfarr

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

Post by Julianfarr » Sat Jun 09, 2012 3:33 am

Funkafonik wrote:
julianfarr wrote:
1. I have quite a few instances of songs in my database which are on more than one album (especially where I have a somg on its original album, and then the same song on a compilation album) - I felt that the play count should only be updated on the album which was actually played.

Jules
What happens to all the songs without/mismatching album tags?
Would it be possible to give options on which album to put these "leftovers/mismatching" scrobbles?

Can't wait for that update, thanks a lot for working on this! :)
As long as you have set up Last.fm scrobbling not to "correct" any of the details, then it shouldn't be any more possible to mismatch the album name than it would be to mismatch the artist name or the track title.

It never occurred to me to cater for tracks with no album name, although I suppose it might work. Everything is logged, so you can check the log, but that would be a pain in the neck to do every time.

Jules

Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

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

Post by Psyker7 » Sun Jun 10, 2012 7:32 am

So I've been working on merging Julianfarr 's changes in, and one issue so far.

Once we've done an initial run, Julian's method simply increments the playcount by plays it finds on last.fm since the most recent run.
However, if you are scrobbling your plays from MM itself (vs just from a mobile device) then these plays will get added twice.

Do people mind this? I'm assuming yes, and as such I cannot merge these changes in without caching the results from last.fm somewhere still which is a big job... sorry folks!

If people don't mind, I'll release a packaged version with his changes - but will probably give the addon a different name, as the end result isn't actually the same.

===========================
I am also having a go at writing this script in python - there's already a last.fm api and I'm most of the way done already to an equivalent of the version 3 beta - but it would require people to install python and pywin32 - http://sourceforge.net/projects/pywin32/ so it's no longer as simple as just installing the MMIP.
The nice thing about writing it in python is we get a storage mechanism much easier - and future maintenance would be much easier for me :D

Funkafonik
Posts: 58
Joined: Fri Feb 13, 2009 12:33 pm

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

Post by Funkafonik » Tue Jun 12, 2012 7:42 pm

Julianfarr wrote: As long as you have set up Last.fm scrobbling not to "correct" any of the details, then it shouldn't be any more possible to mismatch the album name than it would be to mismatch the artist name or the track title.

It never occurred to me to cater for tracks with no album name, although I suppose it might work. Everything is logged, so you can check the log, but that would be a pain in the neck to do every time.
Last.FM wasn't always accepting Album metadata in its first years, and lots of people are scrobbling from streaming websites with incorrect/missing Album data. I personally use the Universal Scrobbler when I view live or music videos on YouTube or elsewhere (with no Album tag).

Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

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

Post by Psyker7 » Sat Jun 23, 2012 8:51 am

If anyone's feeling adventuous:
http://psykar.com/script-files/LastFmIm ... -beta.mmip

I haven't been able to package it all that nicely just yet - you will need to open the MMIP as a zip, and move the 'LastFmImportPython' folder to the scripts directory after installation.
You will also need to have the following installed:
Python2.7: http://python.org/ftp/python/2.7.3/python-2.7.3.msi
Pywin32 http://sourceforge.net/projects/pywin32 ... e/download

After all that, the script should be runnable from the Scripts menu as normal
Features:
should save settings,
should use recent tracks from last.fm meaning accurate times
multithreads the downloads making them MUCH faster (like crazy fast compared to the old version 3 of the original script)
caches all plays downloaded - and doesn't download unneeded files. I do add in about a weeks padding to catch any recent scrobbles which may have been missed

Feedback welcome - I hope to get it packaged nicer in the coming few days!

imoatama
Posts: 2
Joined: Tue Jul 31, 2012 2:52 pm

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

Post by imoatama » Tue Jul 31, 2012 3:06 pm

I have just installed and used this (the VBscript v2.4 one not the python one) on MM 4.0.6.1501 and it works great.

The only problem for me is that I have pretty much always scrobbled with the "çorrect tags" option switched on. My tags are immaculate but for one reason or another in places they differ from last.fm (usually because IMO lfm's tag is wrong or a different interpretation to what i'd choose).

This affects the match rate enough to cause problems, and me being a perfectionist I hate to see albums with eg 15 plays for all but one track which has 0.

I can think of a reasonable way of fixing (or at least improving) this, that doesn't require a bunch of fuzzy-matching rules which I'd rather not get into. Instead you build a dictionary of library track vs last.fm-corrected track using last.fm track.getCorrection API calls. Then you match against the corrected info and use the dictionary to match it to the library track for applying the playcounts.

I'm also seeing some trouble similar to that Jasper complained of - that tracks with the same name and artist but on different albums are being seen as the same for the purposes of playcount. I'd love to see the fix for that make its way into code as well (though not the part where we only apply the change in playcount - I scrobble from everythin separately, including MM!). Is it in the python version? How tested is the python version?

Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

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

Post by Psyker7 » Tue Jul 31, 2012 10:10 pm

The album matching is in the python version, and it's also a bit better with matching over autocorrects because it uses the individual play history vs the aggregated counts.

I've been fairly rigorous with my own testing of it, but unfortunately it seems as though packaging it for a nice install is going to be rather annoying, due to the number of files I have to copy to the scripts directory. I may look at compiling it into an exe, but then people have to take my word that it doesn't do anything bad...

Forgive me for my hatred of vbs, but I don't really have the time to port the features into the vbs - the python version was so much nicer and quicker to code that if I do get a way of distributing it, it will be miles better, not least because it's multi-threaded and can pull down plays 10x as fast.

edit: your idea of using last.fm's autocorrect api is quite good (hadn't occured to me) I'll see if I can get that into the vbs version!

imoatama
Posts: 2
Joined: Tue Jul 31, 2012 2:52 pm

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

Post by imoatama » Tue Jul 31, 2012 11:45 pm

I can totally understand your reluctance to work with vbs, and am highly supportive of the idea of continuing mainly on the python version. I doubt people will mind too much having to install from an exe - re: the trust issue this is an issue for all software. The important thing with installing something like this is that it's only a few clicks, in one atomic process - both a mmip and and exe satisfy this. Is it possible to roll python installation into it as well or are they still separate dependencies?

Is the python version feature-complete compared to the vbs version?

Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

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

Post by Psyker7 » Wed Aug 01, 2012 12:24 am

The python version is feature complete.
I 100% agree that simple installation is important! A compiled exe should actually remove the separate dependencies as well, although my experience with py2exe has been hit and miss. I need to get a few VMs running at home again to test it on a PC without the dependencies installed.

I'll likely have some free time this weekend, shall keep people posted!

Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

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

Post by Psyker7 » Sun Aug 12, 2012 2:17 am

Good news everybody!

I have a working MMIP with no other dependencies of my python version!
Get it from: http://psykar.com/scripts
Direct link: http://psykar.com/script-files/LastFmIm ... -beta.mmip

I've tested it extensively myself, but consider this beta flavoured still. If you run into issues, sending me the log file would be a great help! %appdata%\MediaMonkey\Scripts\LastFmImportPython\Log.txt

Source code is up at https://github.com/Psykar/MM-LastFmImportPython
The tree needs cleaning up but figured I'd shove it up anyway given I'm now distributing an exe. It's compiled with pyinstaller.

BKKKPewsey
Posts: 361
Joined: Sun Jun 05, 2011 10:45 am
Location: United Kingdom

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

Post by BKKKPewsey » Sat Aug 18, 2012 7:33 am

Hi
I have installed the python version on my MM1501 build portable running on Vista 32
Install works fine and it appears to go off and get my user data from Last FM
However it doesn't appear to be updating any tracks :-?

The last part of the log.txt is below:-

Code: Select all

2012-08-18 02:44:08,493: ... done with page 48
2012-08-18 02:44:08,496: Getting page 58...
2012-08-18 02:44:15,032: ... done with page 49
2012-08-18 02:44:20,792: ... done with page 50
2012-08-18 02:44:26,375: ... done with page 51
2012-08-18 02:44:32,138: ... done with page 52
2012-08-18 02:44:38,190: ... done with page 53
2012-08-18 02:44:43,519: ... done with page 54
2012-08-18 02:44:48,588: ... done with page 55
2012-08-18 02:44:53,644: ... done with page 56
2012-08-18 02:44:58,990: ... done with page 57
2012-08-18 02:45:02,444: ... done with page 58
2012-08-18 02:45:04,506: Closing threads.
2012-08-18 02:45:04,506: Threads Closed.
2012-08-18 02:45:57,964: Starting matches
I left MM running for about 20 mins after all activity disappeared in the green activity bar in case of "hidden" processes
I checked my files and they haven't been updated eg playcount and last played remain the same.
Note I tried running MM as admin before installing the add-on but no change.
Any further info reqd just let me know

Regards
BKKK
Everyone has the right to be stupid Image but some abuse the privilege

Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

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

Post by Psyker7 » Sun Aug 19, 2012 7:31 am

BKKKPewsey wrote:Hi
I have installed the python version on my MM1501 build portable running on Vista 32
Install works fine and it appears to go off and get my user data from Last FM
However it doesn't appear to be updating any tracks :-?
Sorry about that, I've updated to 0.3 - seems I forgot to remove a testing bit and updates weren't being done.

Logging should also give a few better messages when stuff fails now. Thanks for giving it a go!

BKKKPewsey
Posts: 361
Joined: Sun Jun 05, 2011 10:45 am
Location: United Kingdom

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

Post by BKKKPewsey » Sun Aug 19, 2012 9:04 am

:D Just tested - it rocks!!!!!
Matched most of the tracks in the database (approx 7000 out of 8000) :) Much better then the old script.
Then checked using the last played auto-playlist - Spot-on - Excellent Work!
Updated the database in under a minute - just wish MM was as quick :wink:

As I play most of my music outside of MM (I use subsonic in jukebox mode) this is a great add-on for me so again
Thank You
Everyone has the right to be stupid Image but some abuse the privilege

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 » Mon Aug 27, 2012 5:07 am

thanks for the update.
but for some reason it won't work for me. it does not update the playstats at all. it seems to collect all the data but does not do anything

Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

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

Post by Psyker7 » Mon Aug 27, 2012 5:29 am

heartofhate wrote:thanks for the update.
but for some reason it won't work for me. it does not update the playstats at all. it seems to collect all the data but does not do anything
Grab the log from %appdata%/MediaMonkey/scripts/LastFmImportPython/log.txt
and either post it here or PM it!

Post Reply