krateng / maloja

Self-hosted music scrobble database to create personal listening statistics and charts
https://maloja.krateng.ch
GNU General Public License v3.0
1.06k stars 63 forks source link

Scrobble does not show up in "All Time" view #310

Open 04nd01 opened 7 months ago

04nd01 commented 7 months ago

I'm reporting this in case it's a sign of a bug that could also be affecting other users. I have noticed a weird inconsistency when scrobbling to an newly created maloja (v3.2.1) instance with only a couple of scrobbles from this month. The first eleven of these scrobbles don't show up anywhere when I filter by "All time". They do however show up when I filter by a certain time frame that includes the current month. example

This issue seems to affect all views and can be reproduced through the API. The URL /apis/mlj_1/numscrobbles returns {"status": "ok", "amount": 27}. The URL /apis/mlj_1/numscrobbles?from=2022 returns {"status": "ok", "amount": 38}.

The scrobbles inside the database look fine and seem to have correct timestamps. Looking at the code, I see that the "get_scrobbles" function itself has a reasonable default value for the "since" argument (since=0). This leads me to believe that, in the case of requesting all scrobbles, the function is not called without that argument but instead it's called with a "since" argument that contains some incorrect timestamp. Unfortunately I'm not familiar with python and haven't been able trace this back to the to the place where the incorrect timestamp is introduced.

krateng commented 7 months ago

Can you isolate when this happens? Is this only on the first run? Or after importing from last.fm?

04nd01 commented 6 months ago

There was no initial import from lastfm. However the issue seems to have resolved itself. I updated the Docker Swarm service with a re-pull of the image and now after reloading the page the counts for "this year" and "all time" match up again.

rlandolt commented 1 month ago

There anyway seems to be an issue with the "All time" history, even on the "Last Scrobbles" view: image

rlandolt commented 1 month ago

image Seems to go trough all views => The all time counter is off on all levels.

Checking the scrobbles table it seems to only count the scrobbles to "All time" where the origin is != "client:browser" (the only one where the part behind "client:" is not in the API list)