Skip to main content
Topic: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (Read 27858 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

Reply #150
Another (dumb) question:
in f2k, if we don't want to show an empty string/variable, we enclose it in [brackets].
And it greatly works with %lastfm_first_played%, but [%lastfm_played_times%] shows [] if its empty.
How can I suppress the [] ?
Yeah, I do this on purpose because I mainly use it in JScript and the '[]' is needed to show that it's an empty array.

If you don't want to show anything in that case you could do:
Code: [Select]
$iflonger(%lastfm_played_times%,2,%lastfm_played_times%,)

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

Reply #151
Uploaded v3.0.6 to the components registry. Don't think there's a reason to force an upgrade as the functionality is identical, only change is that the component was compiled with the release 1.4 SDK instead of the Beta, and the component size was cut in half.

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

Reply #152
Do you ever plan to implement manual importing (and exporting to xml too) of statistics?

I know there's the last.fm import option, but it doesn't really do much for me as my early years on last.fm are a mess. A couple of years ago I downloaded all my last.fm data and with some help of excel I managed to weed out outliers and finally adopt it for original playback statistics component. But it took time and manual tinkering and I'm 100% sure no automation can manage to do that without my own input. Also, you know, maybe one day sites like YouTube or Soundcloud will allow downloading user history through API - another case where manual import would prove useful.

There's also the second reason, a bit more idealistic - the ability to import/export the stats would give me a sense of much more freedom and 'ownership' of my personal data.

 

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

Reply #153
Do you ever plan to implement manual importing (and exporting to xml too) of statistics?
I hadn't considered it before. If I were to ever do something like this, I'd probably export to JSON because it's easier to work with IMO.

Just to be clear, this component doesn't really backup the data from last.fm, it just backs up the data from last.fm for songs that you select (either manually or by playing them) so long as the data in last.fm matches one of the selected songs. So I pull plays for "Song A" from a particular artist, and I get back all the values for "Song A" and "Song B", but only those plays for "Song A" are saved... at least until "Song B" is played. Also, if last.fm has records of plays of "Song C" but it's not in your library (maybe the song title is mispelled locally) then you'll never see those plays recorded. It's not a great way to mirror the last.fm data which I think somewhat limits the value of exporting/importing.

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

Reply #154
If I were to ever do something like this, I'd probably export to JSON because it's easier to work with IMO.
And same with importing, I suppose? Well, JSON importer would be fine, because there's a lot of converters out there (even online like this: http://shancarter.github.io/mr-data-converter), so I could easily transform my xml/xls data.

so long as the data in last.fm matches one of the selected songs
Yeah and that's a problem. When I was importing my last.fm to foo_playcount a few years ago, I only had ~80% of my foobar library tracks matching exactly my last.fm scrobbles. And these should be identical! But last.fm used to have the metadata correction option and also my library was constantly updating thanks to musicbrainz. So yeah, in the end I had to make manual changes in excel (for example: I had to swap all the last.fm's "Florence and The Machine" to stylised name "Florence + The Machine" to match my foobar library).

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

Reply #155
Yeah and that's a problem. When I was importing my last.fm to foo_playcount a few years ago, I only had ~80% of my foobar library tracks matching exactly my last.fm scrobbles. And these should be identical! But last.fm used to have the metadata correction option and also my library was constantly updating thanks to musicbrainz. So yeah, in the end I had to make manual changes in excel (for example: I had to swap all the last.fm's "Florence and The Machine" to stylised name "Florence + The Machine" to match my foobar library).
That's why I relaxed pattern matching in this component from it's initial release. It wouldn't solve your "Florence and The Machine" to "Florence + The Machine" problem, but if your original artist name was "Florence & the Machine" that would have matched.

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

Reply #156
Hi.

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

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


Code: [Select]
Querying last.fm: http://ws.audioscrobbler.com/2.0/?method=user.getartisttracks&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=Saulo%252dAredes&artist=Anti%252dFlag&limit=200&format=json&page=1
Found 0 plays in last.fm (since last recorded scrobble) of Liar

Hope you can help, the component seems great

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

Reply #157
Hi.

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

My username is "Saulo-Aredes" and when I used "Get last.fm scrobbles" the terminal said:
Good catch. last.fm expects that usernames are not escaped (they only allow a-Z, '_', and '-'). I've stopped escaping usernames and things seem to work now.


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

Reply #159
hey, I have a little problem with this plugin and I'm sorry if this already asked before


can I suppress that message? it usually is fine but sometimes it stealing focus when I'm gaming or watching videos and it's getting annoying when it happens too often

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

Reply #160
hey, I have a little problem with this plugin and I'm sorry if this already asked before


can I suppress that message? it usually is fine but sometimes it stealing focus when I'm gaming or watching videos and it's getting annoying when it happens too often
Unfortunately no. It's a requirement when using a separate thread to avoid blocking the main foobar UI. Foobar lets you delay it showing up for 500ms, so if the request completes in less than that time you won't see it. I've asked if there was a way to further delay or completely suppress that dialog and it appears the answer is no.

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

Reply #161
hey, I have a little problem with this plugin and I'm sorry if this already asked before


can I suppress that message? it usually is fine but sometimes it stealing focus when I'm gaming or watching videos and it's getting annoying when it happens too often
Unfortunately no. It's a requirement when using a separate thread to avoid blocking the main foobar UI. Foobar lets you delay it showing up for 500ms, so if the request completes in less than that time you won't see it. I've asked if there was a way to further delay or completely suppress that dialog and it appears the answer is no.
oh so the problem is because my internet connection is trash?
damnit, the problem of living in a 3rd world country lol
thanks for the answer!

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

Reply #162
oh so the problem is because my internet connection is trash?
That or you have a big LastFM playback history - AFAIK the component has to go through all the pages to find the play count and play times (it caches pages for some time, so it much faster afterwards though).

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

Reply #163
That or you have a big LastFM playback history - AFAIK the component has to go through all the pages to find the play count and play times (it caches pages for some time, so it much faster afterwards though).
It goes through all the pages for the currently playing artist, at 200 scrobbles per page. With a full 200 scrobble request, it takes last.fm about 100-150ms to start returning a response, and then however long it takes to your internet to receive 150-200kb of data. On a slow connection it's possible even a single page could take longer than 500ms unfortunately. The less scrobbles you have with an artist the faster it'll go.

The component also minimizes requests by caching (if you're playing only songs by one artist you should never see the popup until you restart foobar), and also checking the last recorded scrobble we know about. So you might have 1000 scrobbles from an artist, but if the component has a record of the scrobble from yesterday it will stop making requests to last.fm if it finds scrobbles before that date in the last response.

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

Reply #164
The only workaround to doing it in the background would be to implement the full threading model of the background request manually, and avoid using the SDK's convenient threaded background process interface.

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

Reply #165
The only workaround to doing it in the background would be to implement the full threading model of the background request manually, and avoid using the SDK's convenient threaded background process interface.
For the record, I do not have the knowledge or skills required to do this. Frankly I'm amazed I was able to write this component to begin with :)

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

Reply #166
Hi there! I've just come across this thread when searching for "user.getArtistTracks". I'm the Last.fm dev who sent the "mildly disturbing" message last year.

Based on the use case presented to me by MordredKLB last year, I have a different suggestion for a replacement API method when user.getArtistTracks goes away, which is that we'll create a new method to retrieve all scrobbles of a specific track.

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

Reply #167
I'm giving a try to this component. I couldn't find any reference in the wiki, nor in this thread about the "Remove duplicate scrobbles", though. I'm not sure I want to remove anything. What exactly is a duplicate scrobble?

EDIT: Sorry I just noticed the tooltip with the explanation.

I'm late

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

Reply #168
Apparently it's not working by me, but maybe I misunderstood the purpose of the component. I was expecting to retrieve the whole scrobbling history of the played track. I tested it with a playlist where all tracks have a few scrobbles, because I play it very often. I can see the popup showing up, but all lastfm fields remain empty. I tried with and without album, and with and without removing duplicates. The console log confirms that the query has been submitted, but the result is always "Found 0 plays in last.fm (since last recorded scrobble)".
I'm late

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

Reply #169
Apparently it's not working by me, but maybe I misunderstood the purpose of the component. I was expecting to retrieve the whole scrobbling history of the played track. I tested it with a playlist where all tracks have a few scrobbles, because I play it very often. I can see the popup showing up, but all lastfm fields remain empty. I tried with and without album, and with and without removing duplicates. The console log confirms that the query has been submitted, but the result is always "Found 0 plays in last.fm (since last recorded scrobble)".
It's on last.fm api's end. I noticed an issue earlier today and it seems the API isn't returning data. There's a thread here: https://getsatisfaction.com/lastfm/topics/the-api-doesnt-seem-to-return-data-anymore

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

Reply #170
Hi there! I've just come across this thread when searching for "user.getArtistTracks". I'm the Last.fm dev who sent the "mildly disturbing" message last year.

Based on the use case presented to me by MordredKLB last year, I have a different suggestion for a replacement API method when user.getArtistTracks goes away, which is that we'll create a new method to retrieve all scrobbles of a specific track.
Yup, I've been in discussions with Ben over on Reddit the last couple days. I really appreciate his willingness to work with me/us on keeping this component alive.

In the next few days I'll be releasing an updated version of this component that will only retrieve scrobbles for a single song, and not an artist's entire scrobble history. This should be seamless to users, but will hopefully have the effect of reducing/eliminating the popups that are sometimes seen when pulling scrobbles. That's a good thing.

However, when retrieving multiple scrobbles for an artist/library it could potentially take a lot longer and will most likely require rate limiting built in to avoid hammering their servers. What this means for you as users is that if you want to pull all scrobbles for a specific artist, the next few days is the best time to do this.

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

Reply #171
Is there a way to add a field like... I don't know % lastfm_last_loved%, which returns one for loved track and 0 for unloved?
(I know there is a script to synchronize the lastfm loved songs, but i can't find a tag field)

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

Reply #172
Also, what do you mean FB got stuck? When you're pulling multiple data for multiple songs at once, the progress bar will appear, and should continue updating. If an artist has a ton of scrobbles, it might take some time to pull all of them so you might see it pause movement for 30s or so, but it'll continue moving again after that.

I managed to pull all of my scrobbles (about 80k out of a 230k tracks library) in less than an hour, but at first I had this freezing issue, too. Eventually I found the cause was not in the component itself, but in scripts triggered by the on_metadb_changed() event.
Usually these scripts were flawless, because even a massive tag update triggers the on_metadb_changed() event once only, whereas if you have many scrobbles of the same artist, foo_enhanced_playcount will fire a continuous series of on_metadb_changed() events. In my case, one of the scripts in question would run four queries if triggered, and by the time the memory used was released, the script might have been triggered several times more by the subsequent scrobbles imports, fast approaching foobar2000's memory cap.
I was able to handle the issue with the fromhook argument, which is always true when the metadb is changed by foo_enhanced_playcount (I was not as lucky with third party applications, such as beaTunes, but this is OT).

I'm still a newbie when it comes to JScript, but I found other scripts by more skilled users did not take this circumstance into account, all the same. So, my advise to who is having foobar2000 freeze while downloading the scrobbling history, is to check whether your scripts have demanding performances triggered by the on_metadb_changed() event.


P.S.
@MordredKLB not a feature request, just curious: have you thought of downloading other lastfm data, such as tags and similar artists?
I'm late

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

Reply #173
I managed to pull all of my scrobbles (about 80k out of a 230k tracks library) in less than an hour, but at first I had this freezing issue, too. Eventually I found the cause was not in the component itself, but in scripts triggered by the on_metadb_changed() event.
Usually these scripts were flawless, because even a massive tag update triggers the on_metadb_changed() event once only, whereas if you have many scrobbles of the same artist, foo_enhanced_playcount will fire a continuous series of on_metadb_changed() events. In my case, one of the scripts in question would run four queries if triggered, and by the time the memory used was released, the script might have been triggered several times more by the subsequent scrobbles imports, fast approaching foobar2000's memory cap.
I was able to handle the issue with the fromhook argument, which is always true when the metadb is changed by foo_enhanced_playcount (I was not as lucky with third party applications, such as beaTunes, but this is OT).

I'm still a newbie when it comes to JScript, but I found other scripts by more skilled users did not take this circumstance into account, all the same. So, my advise to who is having foobar2000 freeze while downloading the scrobbling history, is to check whether your scripts have demanding performances triggered by the on_metadb_changed() event.
I run FB on a VM at work, and I found that when I tried to pull scrobbles for somewhere between 3-4k songs at once FB would freeze up and I'd have to kill it (this losing any scrobbles pulled since the last time FB was exited). On my home PC I could pull scrobbles for 20k songs at a much faster speed, with no issues at all.

I suspected the issue was my JScript foobar theme's on_metadb_changed callback, but I didn't bother making any changes. If you're trying to pull your entire library at once, for maximum safety I'd switch to a default UI theme with nothing loaded other than a playlist panel with your entire library (sorted by artist!). That takes poorly written scripts out of the mix.

Quote
@MordredKLB not a feature request, just curious: have you thought of downloading other lastfm data, such as tags and similar artists?
I haven't since there are other components that I assume do the same thing, and the original intent of this wasn't to be just a last.fm component.

Given the less than ideal changes (IMO) that are about to be added in the new version, I might look at adding some more stuff though.

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

Reply #174
I haven't since there are other components that I assume do the same thing, and the original intent of this wasn't to be just a last.fm component.

I only know of softplaylists which still works, but is not being developed anymore. It actually builds playlists based on tags and similar artists, rather than making the data available for titleformatting (or JScript). Anyway - again not a feature request - but in my ideal world there would be a separate plug-in all about lastfm  ;)
I'm late

 
SimplePortal 1.0.0 RC1 © 2008-2019