Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (Read 128326 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #50
Awesome!

Is anyone actually using this component with v1.3 on windows? If it doesn't work anymore, I want to update the component registry to make that clear.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #51
Just uploaded version 2.1.0 to the component registry.

Changelog:
Added three new properties:
%lastfm_added%
%lastfm_first_played%
%lastfm_last_played%

All return a date/time string like "2018-03-04 12:34:56" exactly the same as their counterparts from foo_playcount. If the time doesn't exist, "N/A" is returned, but $if2, or the bracket format ([%lastfm_added%]) will not display the N/A.

%lastfm_added% and %lastfm_first_played% both return the exact same value, but I created both for convenience. If you'd like to use the most recent date between your foobar library and last.fm you can use this TF code:

Code: [Select]
$ifgreater(%lastfm_last_played%,%last_played%,%lastfm_last_played%,%last_played%)

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #52
Just uploaded version 2.1.0 to the component registry.

Changelog:
Added three new properties:
%lastfm_added%
%lastfm_first_played%
%lastfm_last_played%
Thank you!!! The time I first listened to the songs is the most important information for me.
One question, and apologies if the answer exists already, but I'm not very tech-savvy and I didn't get much of what you describe on the first page that your component does:
is this data stored somewhere locally, in a database or so,
or is the component requesting this information from Last.fm every time it is asked by foobar2000?
In other words, can I retrieve this information (gradually - I got that it can't be done at one go) for all my files permanently?

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #53
Thank you!!! The time I first listened to the songs is the most important information for me.
One question, and apologies if the answer exists already, but I'm not very tech-savvy and I didn't get much of what you describe on the first page that your component does:
is this data stored somewhere locally, in a database or so,
or is the component requesting this information from Last.fm every time it is asked by foobar2000?
In other words, can I retrieve this information (gradually - I got that it can't be done at one go) for all my files permanently?
Yes. The information is stored in a database inside the index-data folder. It will persist even if you delete your last.fm account (so long as you don't delete the database or clear the records for those files).

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #54
So first of all, thanks for the awesome plugin! I've been using it only for a little while but it works great!
I was wondering if it would be possible to add another field to display the total number of plays an album has according to LastFM (the number of scrobbles on the album page), or if that would be too complicated.
I've been trying to display the total number of plays every album has under each album using Facets and your plugin but the way Facets works it creates separate entries of the same album for every track with a different number of plays.

If this is already doable somehow please feel free to enlighten me.
Cheers!

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #55
Hi.

I have a little problem with my username in last.fm and your plugin.

My username is "lovecraft_last" and when I used "Get last.fm scrobbles" the terminal said:

Code: [Select]
http://ws.audioscrobbler.com/2.0/?method=user.getartisttracks&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=lovecraft%255flast&artist=David+Lee+Roth&limit=200&format=json&page=1
Found 0 plays in last.fm (since last recorded scrobble) of Yankee Rose

When I put this link in the web browser it say:

Code: [Select]
error	6
message "User not found"
links []

As you can see the component change the "_" of my username for "%255f".

If I change "%255f" for "_" in the link http://ws.audioscrobbler.com/2.0/?method=user.getartisttracks&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=lovecraft_last&artist=David+Lee+Roth&limit=200&format=json&page=1 I get the correct data for the song:

Code: [Select]
	
artisttracks
track
0
artist
#text "David Lee Roth"
mbid "802d37d5-0aaa-492e-b366-99f75e5a196f"
name "I'm Easy"
streamable "0"
mbid "c40a07d1-7268-4c66-8eb0-5bef550c6e13"
album
#text "Eat 'em and Smile"
mbid "63730b4d-81fd-41b7-89d8-392b5fb34787"
url "https://www.last.fm/music/David+Lee+Roth/_/I%27m+Easy"
image
0
#text "https://lastfm-img2.akamaized.net/i/u/34s/5202c3c6fc7245dca1432869601c3286.png"
size "small"
1
#text "https://lastfm-img2.akamaized.net/i/u/64s/5202c3c6fc7245dca1432869601c3286.png"
size "medium"
2
#text "https://lastfm-img2.akamaized.net/i/u/174s/5202c3c6fc7245dca1432869601c3286.png"
size "large"
3
#text "https://lastfm-img2.akamaized.net/i/u/300x300/5202c3c6fc7245dca1432869601c3286.png"
size "extralarge"
date
uts "1523073904"
#text "07 Apr 2018, 04:05"
1
artist
#text "David Lee Roth"
mbid "802d37d5-0aaa-492e-b366-99f75e5a196f"
name "Tobacco Road"
streamable "0"
mbid "e8954075-2f0d-4482-94e2-432bfe9197e2"
album
#text "Eat 'em and Smile"
mbid "63730b4d-81fd-41b7-89d8-392b5fb34787"
url "https://www.last.fm/music/David+Lee+Roth/_/Tobacco+Road"
image
0
......

Hope you can find a way to fix this, the component seems pretty usefull

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #56
My username is "lovecraft_last" and when I used "Get last.fm scrobbles" the terminal said:
Nice catch! Fixed now.

If that resolves your problem (and nobody else reports an issue) I'll put it up in the official component registry.

BTW: Big changes are coming soon. Almost finished multi-threading and removing all restrictions on amount of scrobbles to retrieve and the max 50 tracks to retrieve from. I haven't seen any issues in 24 hours, but I need to refine a few things still. With any luck I'll have it out for beta by the end of this week.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #57
Yeah, it works now  8)

Code: [Select]
Querying last.fm: http://ws.audioscrobbler.com/2.0/?method=user.getartisttracks&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=lovecraft_last&artist=David+Lee+Roth&limit=200&format=json&page=1
Found 3 plays in last.fm (since last recorded scrobble) of Yankee Rose

Thanks man !!!

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #58
BTW: Big changes are coming soon. Almost finished multi-threading and removing all restrictions on amount of scrobbles to retrieve and the max 50 tracks to retrieve from. I haven't seen any issues in 24 hours, but I need to refine a few things still. With any luck I'll have it out for beta by the end of this week.

hey,

that sounds fantastic! looking forward for it and cant wait to test the beta  :o
Right On.

Kind regards

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #59
that sounds fantastic! looking forward for it and cant wait to test the beta  :o
Right On.

Kind regards
v2.5.0beta1
  • All last.fm calls are now handled outside the main thread, so the UI doesn't block
  • Progress dialog is displayed if all scrobbles aren't retrieved in 500ms
  • Number of scrobbles retrieved per artist no longer limited to 1000, but rather 200 * (maxCacheSize - 1)
  • maxCacheSize value is reset to 40 if the previous value was less than 40 (used to default to 20)
  • Can now retrieve scrobbles on up to 1000 tracks at a time

If I don't see any issues or complaints, I'll probably make this official at the end of the weekend.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #60
v2.5.0beta1
  • All last.fm calls are now handled outside the main thread, so the UI doesn't block
  • Progress dialog is displayed if all scrobbles aren't retrieved in 500ms
  • Number of scrobbles retrieved per artist no longer limited to 1000, but rather 200 * (maxCacheSize - 1)
  • maxCacheSize value is reset to 40 if the previous value was less than 40 (used to default to 20)
  • Can now retrieve scrobbles on up to 1000 tracks at a time

If I don't see any issues or complaints, I'll probably make this official at the end of the weekend.

I just came by to say thank you for the latest version.
It runs very reliably, even with the large number of scrobbles I've collected over the years.

To the point where the max. retrieved scrobble per artists will be reached (currently 9,999?), I'm going to use it with great pleasure.
My top artist leads the way with currently 9,485 scrobbles, so this will not be the case in the next weeks.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #61
Officially released v2.5.1 in the official registry. Just a version bump from the beta for auto-update purposes; no other changes.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #62
I just came by to say thank you for the latest version.
It runs very reliably, even with the large number of scrobbles I've collected over the years.

To the point where the max. retrieved scrobble per artists will be reached (currently 9,999?), I'm going to use it with great pleasure.
My top artist leads the way with currently 9,485 scrobbles, so this will not be the case in the next weeks.
You shouldn't run into any issues. After we have scrobbles for an artist, the next plays only checks scrobbles up to the last recorded scrobble of that song. So if you last scrobbled the song 250 scrobbles ago, it would pull the last 400 scrobbles (we pull 200 at a time) and stop checking for new scrobbles once the timestamp is older than the last scrobble.

If you want to make extra sure you don't miss anything, just select all songs by your artist with the most scrobbles, and then right-click and retrieve scrobbles.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #63
I still see and get version 2.1.1.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #64
I still see and get version 2.1.1.
Whoops. Try now.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #65
Yep, got it. Thank you :)

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #66
I got a mildly disturbing message today from one of the last.fm devs. Apparently they are considering removing the user.getArtistTracks method from their API which would completely break this component's last.fm functionality. As far as I can see there's no other method to retrieve scrobbles of a particular song, so we'd be SOL. The dev wasn't quite sure what I was using the method for though, so hopefully I made my case. I'll let you know if I hear back more info.

Changes currently being worked on:
Adding %first_played_enhanced%, %last_played_enhanced% and %added_enhanced% methods. These would compare (for example) the %first_played% and %lastfm_first_played% fields and return the oldest, etc. Are you guys okay with those field names? I couldn't think of anything better.

I also think I'm going to move the last.fm retrieval to when a song initially starts playing, and not just at the time %play_count% gets increased. I think that will provide a better user experience.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #67
Hm... %lastfm_play_count% always returns 0 for me. Is there any way to enable logs to diagnose the problem?

PS: Internet is accessed via proxy, so if foo_enhanced_playcount does not use fb2k network settings, this might be the cause.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #68
Hm... %lastfm_play_count% always returns 0 for me. Is there any way to enable logs to diagnose the problem?

PS: Internet is accessed via proxy, so if foo_enhanced_playcount does not use fb2k network settings, this might be the cause.
last.fm information is not retrieved automatically. You'll need to first play a song for 1 minute or right click on a track/tracks and retrieve scrobbles. Also make sure you set your username correctly in the settings. You might also need to uncheck the "compare album" option.

If you've done all of those things and are still seeing only zeroes, manually attempt to pull scrobbles and paste what's in the console. I use foobar's HTTP method so it should respect the fb2k settings.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #69
New beta release.

Change list:
  • %last_played_enhanced% (returns latest of %last_played% and %lastfm_last_played%)
  • %first_played_enhanced% (returns earliest of %first_played% and %lastfm_first_played%)
  • %added_enhanced% (returns earliest of %added% and %lastfm_first_played%)
  • Album/Title comparisons for last.fm now ignore all punctuation except for '(', ')', and '&'. This means "Can't Stop?" will match "cant stop" now (comparisons already ignored case). We request scrobbles by Artist, so those matches are determined by last.fm, not the component.
  • Scrobbles now requested on_playback_new_track, and not on_item_played, i.e. immediately and not after 60 seconds of playback
  • All last.fm requests happen out of the main thread, and no longer block the UI. This means you will occasionally briefly see a popup when you begin playing a new track and scrobbles are requested. I wish I could suppress it but it doesn't seem possible.
  • Streamlined a lot of code and removed some several unnecessary db writes, and metadb changed notifications.

Please try it out and let me know if there are any issues. If not it'll be officially released end of this week.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #70
Whoops, I changed the Album/Title strings to strip out punctuation, and then still was doing comparisons with the old strings. Beta 2 fixes it, and removes an unnecessary code path when last.fm retrieval is disabled.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #71
This means you will occasionally briefly see a popup when you begin playing a new track and scrobbles are requested. I wish I could suppress it but it doesn't seem possible.[/li][/list]
Unfortunately it's more frequent than occasionally for me and sometimes it stays for up to 20 seconds. I use displayfusion though and made it so this popup immediately minimizes to tray so it won't bother me.

Love that it requests the data when a track starts now.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #72
Yeah, if you're pulling 10k scrobbles, it could take awhile :) I'd recommend you finding your most frequently scrobbled artists and doing a manual pull on them. Should only take 20 seconds or so for the very first song and then the others should happen more or less instantly as the results are cached. Then when it pulls scrobbles on play it'll only be making one or two requests from last.fm.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #73
last.fm information is not retrieved automatically. You'll need to first play a song for 1 minute or right click on a track/tracks and retrieve scrobbles.
Yup, that was it, thanks!

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript)

Reply #74
Yeah, if you're pulling 10k scrobbles, it could take awhile :) I'd recommend you finding your most frequently scrobbled artists and doing a manual pull on them. Should only take 20 seconds or so for the very first song and then the others should happen more or less instantly as the results are cached. Then when it pulls scrobbles on play it'll only be making one or two requests from last.fm.
Obviously I was talking about a single track fetch :P It's not necessary your component's issue, last.fm or my internet connection could be slow.

The only issue I have is that it's missing some scrobbles sometimes:
Top text is info from your component, it's 11 instead of 18.
Somehow my ancient last.fm WSH panel shows the correct amount.
https://i.imgur.com/hChDnha.jpg