Page 2 of 24

Re: Last.fm Playcount Import [MM3]

Posted: Thu Feb 19, 2009 3:03 pm
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

Re: Last.fm Playcount Import [MM3]

Posted: Thu Feb 19, 2009 3:24 pm
by pierre.osdoit
-

Re: Last.fm Playcount Import [MM3]

Posted: Thu Feb 19, 2009 3:38 pm
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.

Re: Last.fm Playcount Import [MM3]

Posted: Thu Feb 19, 2009 3:45 pm
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 :(

Re: Last.fm Playcount Import [MM3]

Posted: Thu Feb 19, 2009 3:56 pm
by pierre.osdoit
-

Re: Last.fm Playcount Import [MM3]

Posted: Thu Feb 19, 2009 4:34 pm
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?

Re: Last.fm Playcount Import [MM3]

Posted: Thu Feb 19, 2009 5:03 pm
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 )

Re: Last.fm Playcount Import [MM3]

Posted: Thu Feb 19, 2009 5:08 pm
by pierre.osdoit
-

Re: Last.fm Playcount Import [MM3]

Posted: Thu Feb 19, 2009 5:17 pm
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:

Re: Last.fm Playcount Import [MM3]

Posted: Sun Feb 22, 2009 4:32 am
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:

Re: Last.fm Playcount Import [MM3]

Posted: Sun Feb 22, 2009 8:36 am
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.

Re: Last.fm Playcount Import [MM3]

Posted: Sun Feb 22, 2009 8:37 am
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

Re: Last.fm Playcount Import [MM3]

Posted: Sun Feb 22, 2009 8:59 am
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

Re: Last.fm Playcount Import [MM3]

Posted: Sun Feb 22, 2009 9:06 am
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

Re: Last.fm Playcount Import [MM3]

Posted: Sun Feb 22, 2009 9:16 am
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!