Closed Maxmystere closed 1 month ago
Hello!
LMS doesn't scrobble by itself using stream
or download
endpoints. I suggest you inspect LMS logs to extract what MusicAssistant actually asks to scrobble, see https://www.subsonic.org/pages/api.jsp#scrobble
Then we can check if these requests are wrong or if there is something wrong on LMS side (which is possible, as LMS stores listens to scrobble, to retry later in case of failure, etc.)
Seeing the MusicAssistant implementation, it is calling the api with a submission False then True after the end of the stream https://github.com/music-assistant/server/blob/113e51dbf356f7c2aec55d6b5f0908fa8d348c0c/music_assistant/server/providers/opensubsonic/sonic_provider.py#L807:L813
Seeing the logs, it seems to be doing 2 scrobble calls for each song playing which is matching whats visible in listenbrainz : 1 call for the current music and another one for the next music (or for the completion of the last one) I sadly don't have the details of the calls except
[2024-Oct-28 18:57:31.882] 1 - [info] "wthttp: 172.18.0.11 POST /rest/scrobble.view HTTP/1.1 200 109"
Try to change log-level to "debug" in lms.conf, you will get more details
When a song finishes and another start I seem to have the correct scrobbling submission but with wrong id, it's also missing the optional time param
[2024-Oct-28 19:30:06.032] 1 - [debug] - 140592878443320 [API_SUBSONIC] Handling request 84 '/scrobble.view', continuation = false, params = {c=Music Assistant}, {f=json}, {id=tr-1946}, {p=REDACTED}, {submission=True}, {u=Max}, {v=1.16.1}, [2024-Oct-28 19:30:08.283] 1 - [debug] - 140592878746424 [API_SUBSONIC] Handling request 87 '/scrobble.view', continuation = false, params = {c=Music Assistant}, {f=json}, {id=tr-9360}, {p=REDACTED}, {submission=False}, {u=Max}, {v=1.16.1}, [2024-Oct-28 19:33:47.450] 1 - [debug] - 140592878594872 [API_SUBSONIC] Handling request 121 '/scrobble.view', continuation = false, params = {c=Music Assistant}, {f=json}, {id=tr-6669}, {p=REDACTED}, {submission=True}, {u=Max}, {v=1.16.1}, [2024-Oct-28 19:33:50.479] 1 - [debug] - 140592878443320 [API_SUBSONIC] Handling request 124 '/scrobble.view', continuation = false, params = {c=Music Assistant}, {f=json}, {id=tr-6280}, {p=REDACTED}, {submission=False}, {u=Max}, {v=1.16.1},
On a side note the the music assistant is also failing on several getAlbumInfo2 calls which are not implemented
It is fine to not provide time, lms will then use the current time when reporting to LB. Submission set to false should trigger "playing_now" call to LB API in submit-listens Submission set to true should trigger "single" in the same endpoint. Could you check this in lms logs? In debug log level you see the calls done to the LB API.
Sadly the debug doesn't seem to display the submit-listens params but it seems that the playing_now call is never sent because I do not see the "now playing" view on listenbrainz webpage using MusicAssistant
With my phone player (Ultrasonic) it's working well
You can take a look at my listenbrainz if you want
I checked again with manual commands on the LMS's subsonic API, I don't see any obvious problem. Could you please send me the LMS debug logs for a couple songs you listen to at tmp49-tmp49@yahoo.com?
Ah never mind, it comes from "False" that is not matched, and then LMS fallbacks on the default value for this param, which is "true"
The issue is from False != false ?
Yes exactly!
Ho yeah that's always happening ! Thanks for the fix
Hello, I've started using MusicAssistant for my in home music streaming and i've noticed that despite MusicAssistant not having an "enable scrobbling" setting it "works", sadly it seems to be reporting duplicates and wrong timings in the listenbrainz page (Maybe caused by it caching the music file ?)
I have not yet really looked if the issue came from the subsonic implementation of MusicAssistant or the server but i'd gladly take a look myself if you help me with the relevant API route
Thanks a lot for this project btw