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 128321 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

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

Reply #350
I figured there had to be a way and I was simply mishandling things. Thank you for that, this works great!

I had hoped to propagate %added_enhanced% & %first_played_enhanced% to <ADDED_TIMESTAMP> & <FIRST_PLAYED_TIMESTAMP> similarly, but unfortunately it doesn't look like it's possible to fetch those values as timestamps that Playback Stats understands, and I have no idea if it's possible to take the dates returned by those fields and reformat them to timestamps some other way.
Instead, I'm trialling a new <ADDED> field. Upon reflection, it probably isn't too important for Playback Stats to reimport these dates once they're in a tag, as they are not going to be routinely modified. It's the other fields that are modified on every play of a song that represent far too much administration to bother synchronising manually. :P I guess I will cut my losses with those and hope I never lose them from the db.

Thanks once again for this component. I'm cautiously aware that Last FM may not be around for forever, what with the trend towards Spotify/streaming services, so definitely feel it's important to do this legwork pulling my data sooner rather than later.

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

Reply #351
I understand that this component works with the official statistics plugin.

Is there a way to import the scrobbled playcount to the official statistics plugin's data?

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

Reply #352
Just gonna leave this here since I've had the same doubt about foo_lastfm_playcount_sync.

There used to be a script made by marc I think that allowed exporting playcount from lastfm into a db and then importing that db into foobar, but I think that script now has issues.

As a workaround I use this custom column.
Code: [Select]
$ifgreater([%lfm_playcount%],[%play_count%],[%lfm_playcount%],[%play_count%])
$ifgreater(a,b,a,b)

It compares a to b, if a is higher then it shows a, otherwise it shows b. Swap %lfm_playcount% with %lastfm_play_count% for this specific component.

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

Reply #353
Use $max

https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_Reference#.24max.28a.2Cb.29

And that WSH script/foo_customdb from years ago was a filthy hack done when I didn't know any better. But there was a nice last.fm API meaning you could playcount/loved status for 200 tracks in a single web request. Admittedly there was no date info but it was good at the time. But last.fm nuked it and now it's one request per track (or more if the number of plays exceeds the plays per page limit).

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

Reply #354
Many times I find this plugin doesn't fetch the complete last.fm play stats. Here's an example compared to foo_lastfm_playcount_sync



Is there a way to fix this?

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

Reply #355
Because my component is focused purely on Last.fm, I only take artist/title in account ( $meta(artist,0) to be precise )

https://github.com/marc2k3/foo_lastfm_playcount_sync/blob/main/src/DB.cpp#L13

Enhanced playcount does something else entirely..

https://github.com/kbuffington/foo_enhanced_playcount/blob/99b1cbc67105dad0b88213764a1257e4e14a8c59/src/PlayedTimes.cpp#L24L30

This is not a good fit for last.fm data.

edit: I've not even look at how enhanced playcount parses the last.fm server response. I suspect it's very different from mine.

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

Reply #356
Because my component is focused purely on Last.fm, I only take artist/title in account ( $meta(artist,0) to be precise )
I just downloaded all my last.fm scrobbles from https://benjaminbenben.com/lastfm-to-csv/ and the history of each scrobble shows %artist% %album% %title% (and %date%). Why not include %album% in your plugin's fetching or make it an option? Wouldn't that improve accuracy or do you find that level of specificity is redundant?

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

Reply #357
You really are contradicting yourself now. Your original post was complaining about enhanced playcount not showing as many plays as mine and now you want mine broken down my album so you don't see the full total? Madness.

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

Reply #358
You really are contradicting yourself now. Your original post was complaining about enhanced playcount not showing as many plays as mine and now you want mine broken down my album so you don't see the full total? Madness.
Well if you put it like that yeah, but it's a false dichotomy because this assumes it must necessarily be a contradiction for me to wonder why both plugins are presenting their data inaccurately: one underreporting and one overreporting.

It's weird that that foo_enhanced_playcount is underreporting play counts. In the above screen shot that specific track was played 47x from a specific album and 1x time from an EP while foo_enhanced_playcount is only reporting 5 plays.

But your plugin is over attributing play counts and play dates (and I'm not blaming you because this seems like how last.fm is presenting their data on https://last.fm/user/{usernamne}/library/music/{artist}/_/{track title}). One can have different versions of a track but if they share the same %artist% and %title% their play stats will be identical here. For example, with your plugin there is no discrimination between Nirvana's tracks from their MTV Unplugged album and the same track titles from their studio albums even though the MTV Unplugged tracks are acoustic variations of the songs--all the tracks with the same titles get identical play stats.

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

Reply #359
Well it is a stated aim in the docs (just below the gif)

https://marc2k3.github.io/component/lastfm-playcount-sync/

Quote
Stats are grouped by $lower($meta(artist,0) - %title%) with absolutely no consideration for album tags. This generally means the numbers will match anything you see on Last.fm track pages/charts.

There is a bit of history behind it too. The current API we use (user.getTrackScrobbles) is relatively new but I used last.fm for years before where the only API I could use to get playcounts was track.getInfo - this still exists here...

https://www.last.fm/api/show/track.getInfo

I still use it now to check loved status on every play. Because it showed total playcount only, you never able to determine how many plays per album or any first/last played dates at all.

So even when user.getTrackScrobbles came along, I just didn't invest in it to check albums. I did find the ability to get first played / last played dates useful so that's exactly what I do with it now.

user.getRecentTracks has always been around but parsing an entire listening history just isn't feasible in the context of an fb2k component.

edit: track love status is also bound to artist/title. There is no choice at all with the last.fm API.

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

Reply #360
Fair enough. Thanks for the explanation.

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

Reply #361
So I was messing around and got my component to dump out the album totals each time it looks up a track and the most played track on your user account has 133 plays. It got broke down like this...

Overall total - 133
<album missing> - 42
Blue Room - 31
Garden State - 20
Parachutes - 40

Could 42 scrobbles submitted without an album tag be accurate? How about the other totals? Feasible?

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

Reply #362
That's all feasible.

I strongly suspect the reason for the <album missing> values is Last.fm/Audioscrobbler, was not tracking %album% on scrobbles until January 2006. At least based on my Last.fm data dump, all album values are null until precisely 18 Jan 2006 22:51

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

Reply #363
If you're willing to install fb2k v2 in portable mode, you can test this console spamming album total build I made (32bit only). You can play the tracks with the biggest discrepancies you get with enhanced playcount to see what last.fm says??


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

Reply #364
Thanks, will do tomorrow. I'm just about to head out atm.

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

Reply #365
The only thing throwing some of them off is the arbitrary use the ` and ' character in track titles (which on my end get changed by foo_musicbrainz)

foo_musicbrainz has pretty much always* had an option for replacing unicode punctuation with asciii. Picard does the same and it's always recommended, especially if scrobbling. The wider world won't be using musicbrainz so you really want your scrobbles to count towards the titles that everyone else is submitting. Too late for you now though.

*the original developer last updated it in 2012 and it was there then. I can't say for sure about the earliest versions. There might be a changelog entry for when it was added but I'm far too lazy to check that out.

Also, it would have more interesting to compare the album groupings returned against the stats by enhanced playcount that appeared way off. That was the prompt for all of this.
(Replaying here since your request pertains to this component)

It's not very interesting. After I saw the raw Last.fm playback stats I realized the perceived discrepancy in the playback stats was due to the same reason as the perceived discrepancy your component had: the Unicode/ASCII punctuation issue. It would be super nice if both components here were able to overcome this, at least for metadata with the Unicode apostrophe , but for all I know that's much easier said than done.

So it turns out this component is giving accurate readings from Last.fm. The only difference was as you said, foo_enhanced_playback was discriminating tracks based on %album%, your component was not, and the Unicode/ASCII characters issue was compounding my confusion.

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

Reply #366
but for all I know that's much easier said than done.

Correct. Technically possible but it would be really messy and I'm not interested. ;D

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

Reply #367
Since I couldn't find a quick answer to this anywhere (somewhere here would be ideal), where does Enhanced Playback Statistics store the information it collects? I need to uninstall it, hopefully temporarily for diagnostic purposes, but don't want to lose the data it has collected. I am guessing it's fine to just drag the component out of my user-components directory but thought I should double-check first.

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

Reply #368
Removing the component won't touch the data. It will still be there if you restore the component later.

It's stored inside the index-data folder for fb2k 1.x users or inside metadb.sqlite file for fb2k 2 users.

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

Reply #369
Since I couldn't find a quick answer to this anywhere (somewhere here would be ideal), where does Enhanced Playback Statistics store the information it collects? I need to uninstall it, hopefully temporarily for diagnostic purposes, but don't want to lose the data it has collected. I am guessing it's fine to just drag the component out of my user-components directory but thought I should double-check first.
You could start foobar2000 in save mode. Terminate foobar2000 in task manager, next time you start it, it should ask whether to run it in safe mode.

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

Reply #370
Hmm... no need, I believe foo_enhanced_playcount is responsible for the extreme CPU use I'm experiencing. I haven't had further problems since removing it. No-one else having problems like this? I hope I am not the only one.

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

Reply #371
Removing the component won't touch the data. It will still be there if you restore the component later.

It's stored inside the index-data folder for fb2k 1.x users or inside metadb.sqlite file for fb2k 2 users.

tell me how to update correctly from 1.6 to 2.0 in the 19th beta, the foo_enhanced_playcount started working again - is there a need to transfer the index-date folder? Now the foo_enhanced_playcount stores data in the metadb.sqlite? What to do with the folder index-data??

what are the differences between  foo_lastfm_playcount_sync
 and foo_enhanced_playcount where does your plugin save data? Is it possible to get statistics by day? I have studied the last fm website since the beginning of 2000, I have statistics on tracks - on what day what was played - which plugin is responsible for this? How to save it when switching to 2.0?

advise me which kit to leave for scrobbling, otherwise I'm clogging up the player with duplicates again

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

Reply #372
@MordredKLB tell me how to transfer settings from 1.6 to 2.0 in the old player, all ratings and history are in the index folder and in the new one in the database sql, how else can I import from the site last.fm database back?

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

Reply #373
Hmm... no need, I believe foo_enhanced_playcount is responsible for the extreme CPU use I'm experiencing. I haven't had further problems since removing it. No-one else having problems like this? I hope I am not the only one.

I re-installed the component today hoping that the CPU use may no longer be a concern (EDIT: sadly it still is, manual pulling triggered it), however automatic scrobble pulling is broken. When I press "reset" it fetches the date of the day I removed the plugin (2022-10-29), then if I close and re-open its preferences, the next historical pull date is mentioned as being 1970-01-01. Manual pulling of scrobbles still works, but of course I've listened to quite a lot of music in the interim... how can I fix this?

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

Reply #374
I re-installed the component today hoping that the CPU use may no longer be a concern (EDIT: sadly it still is, manual pulling triggered it), however automatic scrobble pulling is broken. When I press "reset" it fetches the date of the day I removed the plugin (2022-10-29), then if I close and re-open its preferences, the next historical pull date is mentioned as being 1970-01-01. Manual pulling of scrobbles still works, but of course I've listened to quite a lot of music in the interim... how can I fix this?
What version of foobar are you using?

As you might have noticed this component hasn't been updated in 4 years or so because it was basically working flawlessly AFAIK (things might have changed in 2.0, but I had trouble when my foo_playcount stats didn't migrate over, so I gave up).

The component checks for scrobbles in two directions, starting with the last scrobble it knows about. It checks forward in time to get all scrobbles since that last scrobble it has recorded this syncs you up with syncing from other devices/foobar instances/or while you had the plugin removed, so that date 2022-10-29 makes sense.
Then it checks backward from that date 1000 scrobbles at a time (and rarely) to get all your historical scrobbles. Once it finally reaches the last scrobble in last.fm, it starts back over at the last scrobble it knows about, just in case some were missed in the interim. 1970-01-01 is the unix epoch, so presumably it thinks the last scrobble time is zero? I'm wondering if there's an issue writing the cfg file for the component (or reading from it?). Again, this may be all related to 2.0, but I haven't tried it. I'll give it a shot soon though.