Skip to main content

Notice

Please be aware that much of the software linked to or mentioned on this forum is niche and therefore infrequently downloaded. Lots of anti-virus scanners and so-called malware detectors like to flag infrequently downloaded software as bad until it is either downloaded enough times, or its developer actually bothers with getting each individual release allow listed by every single AV vendor. You can do many people a great favor when encountering such a "problem" example by submitting them to your AV vendor for examination. For almost everything on this forum, it is a false positive.
Topic: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (Read 48420 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 #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.

 
SimplePortal 1.0.0 RC1 © 2008-2021