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

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

Moderators: Peke, Gurus

nohitter151
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Re: Last.fm Playcount Import [MM3]

Post by nohitter151 »

pierre.osdoit wrote:Hello,

I've been using iTunes for a while now, and because of growing discontent towards the app (and growing satisfaction using Mediamonkey), I am in the process of switching to MM full time. However, I've had a few difficulties to find ways to import some information I used a lot with iTunes, to make it up-to-date in MM, most notably the play count which I use much for smart playlists.
Nothing against this script (it looks great!) but you should already be able to import iTunes playcounts natively with MM, probably with much less trouble than if using this script. Look here: http://www.mediamonkey.com/support/inde ... ticleid=73
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.
pierre.osdoit
Posts: 4
Joined: Thu Feb 19, 2009 2:33 pm

Re: Last.fm Playcount Import [MM3]

Post by pierre.osdoit »

-
Last edited by pierre.osdoit on Thu Sep 15, 2016 5:36 am, edited 1 time in total.
nohitter151
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Re: Last.fm Playcount Import [MM3]

Post by nohitter151 »

pierre.osdoit wrote:Thanks for your answer, however, I tried importing m3u lists, and unfortunately, Play Count and play history are the very few data not carried over in a m3u list... (as I dscovered on the MM site: "Times played" data isn't transferred http://www.mediamonkey.com/sw/webhelp/n ... erties.htm)
Tried it today, all songs in my library are currently at "0" plays.
No, of course play counts are not stored in .m3u files, those are only for playlists. What I mean is MM can import track data from the iTunes database directly. From the help article I linked to:
MediaMonkey imports:
Track properties: from track tags
Playlists: from .m3u files
Track Ratings and Play history: from Windows Media Player, iTunes, and Winamp DBs.
Album Art: from track tags and any folders that contain tracks from a single album
You just have to run File -> Add/rescan and make sure that the iTunes database is included in the scan.
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.
Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 »

pierre.osdoit wrote:However, I get an error stating that "There is no charts for this user".
Going back to my last.fm account, it seems I actually have some playcount information up to date with iTunes, but no weekly charts..

Is there a way I could get the script to point to this address (http://www.lastfm.fr/user/posdoit/charts), which has the play history gathered from iTunes? Is there another way to import this information from iTunes?

Thanks a lot for your help for my newbie question!
Just wait a week and weekly charts will be created. However, I think you'll find that this won't do what you're hoping as last.fm only has playcounts of plays made while you had the account. In Other words it doesn't read a players database and sync playcounts, rather it takes note of songs you actually play, entirely separatly, so it won't get the historica data from iTunes :(
pierre.osdoit
Posts: 4
Joined: Thu Feb 19, 2009 2:33 pm

Re: Last.fm Playcount Import [MM3]

Post by pierre.osdoit »

-
Last edited by pierre.osdoit on Thu Sep 15, 2016 5:36 am, edited 1 time in total.
nohitter151
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Re: Last.fm Playcount Import [MM3]

Post by nohitter151 »

pierre.osdoit wrote:
nohitter151 wrote:You just have to run File -> Add/rescan and make sure that the iTunes database is included in the scan.
Unfortunately, I tried that as well when I first imported my music, and tried again a moment ago, to no avail..
Is there any other existing script that may help, other than "manually" setting the playcount for moreless each song with "Add/Remove Playstat"?
Were you prompted to import the info from iTunes?
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.
Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 »

trixmoto wrote:It might be worth adding the option for people to register for their own key and use it in your script, rather than provided your own - just a thought! :)
AFAIK the API key is designed to be distributed with an application to be used by other people, others shouldn't need to register for an API key just to use this script.

Of course if you really want to, there are two places it needs replacing in the LoadXML function (Yeah yeah, so I should've made it a const... sue me :P )
pierre.osdoit
Posts: 4
Joined: Thu Feb 19, 2009 2:33 pm

Re: Last.fm Playcount Import [MM3]

Post by pierre.osdoit »

-
Last edited by pierre.osdoit on Thu Sep 15, 2016 5:37 am, edited 2 times in total.
nohitter151
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Re: Last.fm Playcount Import [MM3]

Post by nohitter151 »

pierre.osdoit wrote:
nohitter151 wrote: Were you prompted to import the info from iTunes?
Actually I wasn't. Is there any way I could trigger this?
Thanks a lot for your help!
Look at this post:
http://www.mediamonkey.com/forum/viewto ... rt#p173488

.. and if you need more help let's move the discussion there so as to not hijack Psyker7's thread.

Sorry Psyker7 :oops:
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.
Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 »

Changes: 1.4
- HUGE speedup - no more .updateall() rather only update the track that needs it with
updateDB()


When I say *huge* I mean from hours to seconds. Huge blunder in the coding obviously :P

This now runs on my own database of 18 000 tracks in about 20 seconds + download time for xml sheets if there are no updates required (in this case xml download took longer!)

On an older version of my db, which needs ~ 5000 tracks updating (same # overall) it takes 80 mins
(All testing with latest beta - 3.1.0.1224)

Again, if so required, to find out which tracks are being updated, change the line

Code: Select all

Const ForReading = 1, ForWriting = 2, ForAppending = 8, Logging = False, Timeout = 25
To

Code: Select all

Const ForReading = 1, ForWriting = 2, ForAppending = 8, Logging =True, Timeout = 25
====
I feel bad for anyone who tried to run the older version now :oops:
m0nkiii
Posts: 15
Joined: Mon Feb 26, 2007 1:48 pm
Location: Swiiiiden

Re: Last.fm Playcount Import [MM3]

Post by m0nkiii »

Do you mean that it should take seconds to update the database or is it just seconds when there's no updates in the database.
With my ~25 000 tracks it looks like it would take some hours to update.
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Last.fm Playcount Import [MM3]

Post by nynaevelan »

Wow!! It took less than a minute to check through my @15,000 tracks, major improvement. Keep up the great work. :D Although if I had my way it would include a log that only included the tracks that were updated or even better an option to go through in simulation mode to see which tracks would be updated. (hint, hint :wink: )

Nyn
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
Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 »

m0nkiii wrote:Do you mean that it should take seconds to update the database or is it just seconds when there's no updates in the database.
With my ~25 000 tracks it looks like it would take some hours to update.
It all depends.
If there are lots of tracks which need updating it will take some time.
If your playcounts are quite accurate already, or no counts need updating, it will be very quick.


nynaevelan wrote:Wow!! It took less than a minute to check through my @15,000 tracks, major improvement. Keep up the great work. :D Although if I had my way it would include a log that only included the tracks that were updated or even better an option to go through in simulation mode to see which tracks would be updated. (hint, hint :wink: )

Nyn
The dialog at the end gives you an indicator of if it actually did anything, and you can make a log file easily enough by changing the line in the script.

I'm a bit of a vbscript novice so getting a nice gui log up might be a little longer ;) Although a simulated log without doing updates should be straight forward, so I'll get onto it :D
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Last.fm Playcount Import [MM3]

Post by nynaevelan »

Psyker7 wrote:
Nyn
The dialog at the end gives you an indicator of if it actually did anything, and you can make a log file easily enough by changing the line in the script.[/quote]

Just tell me what to change and I will get on it.
Psyker7 wrote:'m a bit of a vbscript novice so getting a nice gui log up might be a little longer ;) Although a simulated log without doing updates should be straight forward, so I'll get onto it :D
I do not need anything fancy, the way it is now is good enough for me but I am having trouble distinuguishing what the actual changed tracks are. :oops: But thanks for considering my requests.

Nyn
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
Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 »

nynaevelan wrote: Just tell me what to change and I will get on it.
Nyn
Go to
MM Folder\Scripts\LastFmImport.vbs - open it in notepad or wordpad by right clicking -> open with ...

Change the line:

Code: Select all

Const ForReading = 1, ForWriting = 2, ForAppending = 8, Logging = False, Timeout = 25
To

Code: Select all

Const ForReading = 1, ForWriting = 2, ForAppending = 8, Logging = True, Timeout = 25
(It's located near the top, shouldn't be hard to find)

Running the script will then create a file
LastFmImport.vbs.txt
in the same directory, assuming any files actually *were* updated.

Obviously if you have already run the script it won't actually do anything, you'll have to use an older version of your database.

Glad to hear you like it!
Post Reply