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 153401 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 #325
Edit: I'm just realizing that doesn't solve the ask which was most played songs IN a year, and not FROM a year :)

Yep that's the point. You can use queries to get most played songs and limit it within a time frame. It's the more similar thing doable with standard TF and queries.
But there is no workaround to get most played songs in a year without js. You need %played_times% for that,  and $meta_num/$meta(prop, index) don't work with those fields.

Quote
Unfortunately, there's no way to write a component that honors the $meta_num/$meta(prop, index) standard (because it's not a meta field) so to maximize use of this component you will really need to have a JScript/WSH panel where you can actually loop through the JSON arrays and do fancy things. IMO, %played_times_js% and %lastfm_played_times_is by far the most useful because you can actually do stuff with it, i.e. after retrieving the value, looping through and calling new Date() on it. Will add some example code for that.

EDIT: if I am not mistaken, your theme has a "track lifetime" bar or something similar which already uses those fields. Maybe it makes sense to integrate the" most played tracks from X year" playlist creation script as a button there (?). I'm going to take a look at it, so you could reuse it for your theme.

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

Reply #326
Can I add the iTunes play counts to my foobar play_counter using this plugin? If not, any other ideas?
Not unless you were scrobbling to last.fm from iTunes (which is what I do).

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

Reply #327
EDIT: if I am not mistaken, your theme has a "track lifetime" bar or something similar which already uses those fields. Maybe it makes sense to integrate the" most played tracks from X year" playlist creation script as a button there (?). I'm going to take a look at it, so you could reuse it for your theme.
I probably won't directly integrate it into the theme, but it's an interesting problem (that I wish I had time to solve), so if you come up with something cool I'd love to see it.

And now that I think about it, it could potentially work as a menu item along with some other cool playlist generation things....

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

Reply #328
Hello,

I'm seeing this:
Code: [Select]
Querying last.fm: http://ws.audioscrobbler.com/2.0/?method=user.getTrackScrobbles&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=error&artist=Tyler, the Creator&track=Bastard&limit=200&format=json&page=1
foo_enhanced_playcount: Exception making call to last.fm: Network error
Found 0 scrobbles in last.fm of "Bastard"
is this normal or not working?
Not normal. I can load that URL, but it appears you haven't scrobbled that song before though (you still shouldn't get a network error). Are you able to load it in a browser? If that is still happening, or happening on every track possible something is blocking you from accessing last.fm.

Yes i'm able to access the link through a browser fine and it does show the previous plays for certain tracks i tested but i keep getting that network error in the console.

Edit: i'm dumb lol, i checked the network settings and found out i had set some old proxy settings so once i removed those it's working fine now!

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

Reply #329
Thanks for trying to help regor & MordredKLB
Yes, this is what I want : most played tracks in 2020, or another year (relative count). I don't want most played tracks (absolute count) that were also played at 2020.
I think it's a useful and interesting feature because you can have a look in the past, to see what songs you played the most 5 years ago, or 3 years ago, for example
So you can have playlists like this:
 Most played songs in 2019
    Artist            Title             Play count (or if possible, lastfm_play_count)
1. Bon Jovi    - Always          25
2. Inna           - Hot              20
3. Madonna  - Frozen          15
.........................
.........................
50.Def Leppard - Hysteria     2

Most played songs in 2018
   Artist         Title                     Play count (or lastfm_play_count)
1. Tiesto       - Just Be               35
2. Basto       - Again & again   20
3. Bon Jovi   - Always               10
.........................
.........................
50. Smokie   - Carol                   1

I asked this question here because I noticed this on the first page of this component:
%lastfm_played_times% - Date formatted list of scrobbles: ["2012-08-04 15:58:37", "2012-12-10 14:40:46", "2018-01-02 23:38:13"]
%lastfm_played_times_js% - JS timestamp list: [1344117517000, 1355172047000, 1514957893000]
I thought that maybe with this component or a script for SMP it might be possible. So I asked here because MordredKLB has also his Georgia theme, and then I thought to ask regor because he also has very interesting scripts, but luckily regor noticed my post.
regor I'll send you an email to send me those files because I'm also interested about those scripts, but I will comment on your page because I have a few questions.
So, is it possible to achieve this with a script : Most played songs in 2020 (relative count), or 2017, or any other year ?

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

Reply #330
It's not all that difficult to write a script which would generate a playlist of all songs with a last_played in the last 52 weeks (or whatever), but things get much more complex and computationally intensive if you want to get number of plays in a certain arbitrary date range (i.e. in 2016). To achieve the second you'd need to again generate a list of any song played after 2016-01-01, then iterate through every entry in that list, pull %lastfm_played_times_js% for every song, then filter the output of each one of those calls to lop off any song before <2016 or >=2017. Then you'd count the times that were left in that range, and shove them into an ordered array and only keep the top 50.

Probably take an hour or two to write up and get working perfectly, but depending on the size of your library and how many plays/scrobbles, could potentially take several seconds or more to generate.

Edit: On further thought:
1) Generate a handle list of all songs with a last played >= 2016-01-01 saved as start
2) Generate a handle list of all songs with a first played >= 2017-01-01 saved as end
Sort both lists, then call start.MakeDifference(end) would drastically cut down on the number of songs you'd need to filter times for.

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

Reply #331
How many people are currently using either any of the %played_times_XXXX% properties, or the %lastfm_played_times_XXX% properties?

I'm considering either changing the behavior of %played_times% or adding a new %played_times_combined% which would hopefully eliminate 90-95% of the duplicates (depending on how often you pause songs in the first minute of play) and just return a list of all foobar and lastfm scrobbles in one call.

I'm wondering if there's even demand for this.

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

Reply #332
The download link for the latest version seems to be missing from the component page.

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

Reply #333
The download link for the latest version seems to be missing from the component page.
Weird. Should be fixed now.

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

Reply #334
Not retrieving ANY scrobbles... this has happened for a while.

I have the foo_audioscrobbler installed which successfully submits to Last.fm. In the log I get the following error when it tries to retrieve the statistics:

Quote
Querying last.fm: http://ws.audioscrobbler.com/2.0/?method=user.getTrackScrobbles&api_key=XX&user=woodee&artist=Within Temptation&track=In Vain&limit=200&format=json&page=1
last.fm Error: Login: User required to be logged in

Didn't know if it was safe to post the API key so replaced with XX.

Any help?


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

Reply #336
Perhaps you've enabled the setting on the last.fm website that hides your recent listening history. This would affect the API as well.

THANKS!!

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

Reply #337
Hello! I'd like to make a request. I wanna start off saying this is one of my favorite components, I really have to thank MordredKLB for making it as it’s one of my favorite things that you can do on foobar!

Is there any way that this component's playcount could supplant foo_playcount's? So %lastfm_play_count%'s value could be stored in %play_count% and therefore, components like Facets could display it as a statistic.

I am using this component by itself, that is, without foo_playcount alongside it. This works perfectly well for my purposes as -unless I'm misunderstanding something- I'm not interested in keeping a different set of playback statistics separate from lastfm. However, my setup makes extensive use of foo_facets, which supports foo_playcount and can display aggregate playcounts for different columns (playcount totals for artist, album, etc.) but, it can’t display aggregate statistics of custom fields, so it can't show aggregate lastfm playcounts. I’ve been trying to find a way around this but I haven’t found any, and sadly, the author of foo_facets doesn't seem to be active anymore.

 :-[ I realize I might not be using this component the way it's intended and I don't know how hard it'd be to implement this, so I apologize if this request is a little ridiculous. Thanks.

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

Reply #338
Is there any way that this component's playcount could supplant foo_playcount's? So %lastfm_play_count%'s value could be stored in %play_count% and therefore, components like Facets could display it as a statistic.
Short answer is yes, but I won't do it.

Conceivably I could alter the component so that it also registered itself as watching %play_count%, then it would return my playcounts instead of foo_playcounts. Of course that would cause problems at best if you had both components installed, and probably get me in trouble with Peter and my component kicked off the registry at worst. There might be some way to only provide this behavior if foo_playcount is not installed, or through some kind of opt-in only option, but frankly it's not worth the confusion/risk/dev effort IMO.

I don't use Facets, so I have no idea if there's someway to alter the aggregate playcounts to use a custom field. If not, your request is better placed over there assuming that component is still maintained.

Sorry!

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

Reply #339
Ah, I see. And yes, sadly Facets doesn't seem to be maintained anymore and it's a shame since I really love the way it works but it'd be great to have features like this.
Thanks for taking the time to reply and explain!  :)

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

Reply #340
can display aggregate playcounts for different columns

why not display a facets column such as:
$max(%play_count%,%lastfm_play_count%)

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

Reply #341
why not display a facets column such as:
$max(%play_count%,%lastfm_play_count%)

This is no good. Statistics columns calculate totals for the whole group so lets say you had an Album pane and an album has 10 tracks with 5 plays of each track, it would show a total of 50 plays. It's impossible to do this custom columns/standard title formatting.

Conceivably I could alter the component so that it also registered itself as watching %play_count%, then it would return my playcounts instead of foo_playcounts. Of course that would cause problems at best if you had both components installed, and probably get me in trouble with Peter and my component kicked off the registry at worst.

With both components installed, they would battle it out for precedence on startup so the first component loaded would take control. It's supposed to random on every restart assuming Peters own components are not given preference over 3rd parties. But like you say, trying to take over someone else's clearly defined fields is not cool!!

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

Reply #342
Could this component check loved tracks as well? or anything else out there that does this?

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

Reply #343
https://github.com/marc2k3/foo_jscript_panel/wiki/Other-Components#foo_lastfm_playcount_sync

As the name implies, it fetches playcounts like this component but has support for importing all loved tracks and if you authorise your Last.fm account, it can love/unlove up to 20 tracks at a time.

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

Reply #344
How can I sort the highest value between Playcount or LastFm playcount in descending order ?
Currently I have this ( in Advanced - Display - Standart sort) :

$if($max(%play_count%,%lastfm_play_count%),$num($max(%play_count%,%lastfm_play_count%),3)|$if2(%album artist%,...)|['['%date%']' ]$if2(%album%,...)|[[%discnumber%.]%tracknumber%. ][%track artist% - ]%title%)

But it's in ascending order. If anyone can help, thanks

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

Reply #345
How can I sort the highest value between Playcount or LastFm playcount in descending order ?
Currently I have this ( in Advanced - Display - Standart sort) :

$if($max(%play_count%,%lastfm_play_count%),$num($max(%play_count%,%lastfm_play_count%),3)|$if2(%album artist%,...)|['['%date%']' ]$if2(%album%,...)|[[%discnumber%.]%tracknumber%. ][%track artist% - ]%title%)

But it's in ascending order. If anyone can help, thanks

This is usually done like:

$sub(10000,$if($max(%play_count%,%lastfm_play_count%),$num($max(%play_count%,%lastfm_play_count%),3))

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

Reply #346
Huge thanks @MordredKLB
I just reminded some useful info (hopefully), and since it's related with foo_enhanced_playcount I should post this here, if it's ok. For those that use this component and also listen to music on a android phone there is a very useful app, Pano Scrobbler for LastFM (https://play.google.com/store/apps/details?id=com.arn.scrobble&hl=en_US&gl=US). Scrobble from anything including video streaming apps, less known audio players or even a song playing in your IM app. You can even scrobble from Youtube app, something that the official Last.fm app can't do. This way, your scrobbles will be more accurate, for example if you listen a song on youtube (using a phone) and you have that song also in your library, foo_enhanced_playcount will retrieve those scrobbles.

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

Reply #347
Huge thanks @MordredKLB
I just reminded some useful info (hopefully), and since it's related with foo_enhanced_playcount I should post this here, if it's ok. For those that use this component and also listen to music on a android phone there is a very useful app, Pano Scrobbler for LastFM (https://play.google.com/store/apps/details?id=com.arn.scrobble&hl=en_US&gl=US). Scrobble from anything including video streaming apps, less known audio players or even a song playing in your IM app. You can even scrobble from Youtube app, something that the official Last.fm app can't do. This way, your scrobbles will be more accurate, for example if you listen a song on youtube (using a phone) and you have that song also in your library, foo_enhanced_playcount will retrieve those scrobbles.

I use Simple Last.fm Scrobbler (SLS) for the same thing on Android. Not sure if it has the same number of apps that Pano supports, but it does give you a list of every player on your device that it recognizes and you can enable or disabling scrobbling from each one.

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

Reply #348
I'm late to the party! I began using this component a few days ago, feeling that I wanted to convert a whole bunch of single-value Artist tags into multi-value and enjoy improved functionality from the Album List panel. Of course this has ramifications upon Last FM, so began pulling my 13yr scrobbling legacy before making more tag changes, and meanwhile hoping the Last FM overlords don't banish me for being too eager! Going well so far though. Thank you MordredKLB for all your work!

I use the "Automatically synchronize file tags with statistics" setting in Playback Statistics advanced prefs, and have a rather convoluted Playcount column that displays $max(%play_count%,%lastfm_play_count%), while also running an $ifequal comparison of the aforementioned against $meta(PLAY_COUNT) and throwing up a red X in the column if there is a mismatch. I also have Context Menu buttons for Importing/Exporting Playback Stats. However, I cannot figure out a convenient way to write %lastfm_play_count% to the PLAY_COUNT tag. I have PLAY_COUNT as the linked metadata field for the column, so whatever number is displayed I can type it in the field and from there import it into Playback Statistics so that all three playcount values are synchronized, but repeating this process for thousands of songs is obviously not practical. The very best I can figure out how to do at the moment is open an ALL playlist, sort by playcount, then select all songs with the same number in turn and bulk-edit <PLAY_COUNT> under properties. Eugh.

As for why I'm doing this, it's a "once bitten, twice shy" situation, as I have lost statistics in the past for one reason or another, and having stats written to tags (in my case external tags) reduces the likelihood of that happening again in future.

So, feature request: I'm wondering if you would consider adding similar context menu options, to Import/Write Enhanced Statistics to/from file tags, and a similar Synchronization option? I've tried to use Masstagger's "Copy values between fields" option, but since %lastfm_play_count% isn't a metadata field, I'm not sure if there is anything I can type there to invoke it (I've tried LASTFM_PLAY_COUNT, SCROBBLES, __SCROBBLES etc... nothing works.) If you have any other advice that would be lovely.

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

Reply #349
So, feature request: I'm wondering if you would consider adding similar context menu options, to Import/Write Enhanced Statistics to/from file tags, and a similar Synchronization option? I've tried to use Masstagger's "Copy values between fields" option, but since %lastfm_play_count% isn't a metadata field, I'm not sure if there is anything I can type there to invoke it (I've tried LASTFM_PLAY_COUNT, SCROBBLES, __SCROBBLES etc... nothing works.) If you have any other advice that would be lovely.
I haven't added this because I don't personally need it, and it can already be done with Masstagger using the "Format Value from Other Fields" option:



For your use you'd probably want to set PLAY_COUNT to be $max(%play_count%,%lastfm_play_count%)