lyarenei / jellyfin-plugin-listenbrainz

ListenBrainz plugin for Jellyfin.
MIT License
79 stars 3 forks source link

Scrobbling multiple artists fails with some filetypes #49

Closed rasmuslos closed 1 year ago

rasmuslos commented 1 year ago

For some reason Jellyfin parses metadata tags different, depending on the filetype. Both Id3 2.4 (mp3) and Vorbis comments (flac) support multiple values for the same key, but Id3 tags are joined with ; and Vorbis comments with /. This results in listenbrainz rejecting a scrobble request when listening to a flac file with multiple artists.

While research the issue I found that only ; is use to split ids, not ; (https://github.com/lyarenei/jellyfin-plugin-listenbrainz/blob/main/src/Jellyfin.Plugin.ListenBrainz/Extensions/AudioExtensions.cs#L50)

Here are some logs of the bug:

Jellyfin  | URI: https://api.listenbrainz.org/1/submit-listens
Jellyfin  | Data: {"listen_type":"single","payload":[{"listened_at":1696105648,"track_metadata":{"artist_name":"Hans Zimmer & The Disruptive Collective","track_name":"No Time to Die Suite (live)","release_name":"HANS ZIMMER LIVE","additional_info":{"artist_mbids":["e6de1f3b-6484-491c-88dd-6d619f142abc/8927cee6-63c0-4fc3-9ddb-3262f8f5051e"],"release_group_mbid":"6b3986f9-1782-4afe-a1fd-f310f5229183","release_mbid":"5de50ad8-6325-4542-a141-9ad50378536c","track_mbid":"a96f877c-9c8c-4daa-8f75-7b8bff7f1db3","track_number":14,"tags":[],"media_player":"Jellyfin","submission_client":"ListenBrainz plugin for Jellyfin","submission_client_version":"3.1.0.1","duration_ms":350000}}}]}
Jellyfin  | [20:27:28] [DBG] [66] Jellyfin.Plugin.ListenBrainz: Response status is BadRequest, will not retry
Jellyfin  | [20:27:28] [DBG] [66] Jellyfin.Plugin.ListenBrainz: Got response (b04df7b):
Jellyfin  | Status: BadRequest
Jellyfin  | Data: {"code":400,"error":"artist_mbids MBID format invalid.","listened_at":1696105648,"track_metadata":{"additional_info":{"artist_mbids":["e6de1f3b-6484-491c-88dd-6d619f142abc/8927cee6-63c0-4fc3-9ddb-3262f8f5051e"],"duration_ms":350000,"media_player":"Jellyfin","release_group_mbid":"6b3986f9-1782-4afe-a1fd-f310f5229183","release_mbid":"5de50ad8-6325-4542-a141-9ad50378536c","submission_client":"ListenBrainz plugin for Jellyfin","submission_client_version":"3.1.0.1","tags":[],"track_mbid":"a96f877c-9c8c-4daa-8f75-7b8bff7f1db3","track_number":14},"artist_name":"Hans Zimmer & The Disruptive Collective","release_name":"HANS ZIMMER LIVE","track_name":"No Time to Die Suite (live)"}}
lyarenei commented 1 year ago

Yeah, multiple values in tags were always an issue and not only in JF. It seems it will be properly sorted out with JF 10.9 though - or at least the issue in JF repo is now closed as resolved.

Added / as a separator in #50. I will release it in version 3.1.1.0 later this day.

rasmuslos commented 1 year ago

Thanks a lot! As far as I can tell it is not jet sorted out in the latest version, as I encountered the problem while running on the unstable version

lyarenei commented 1 year ago

@rasmuslos Plugin version 3.1.1.0 has been released. I'll close this issue for now, let me know if there are still any issues. Thank you.

moisespr123 commented 2 months ago

@lyarenei seems APEv2-tagged files may be using ", " as separator (comma + space). #103 should fix this.

Thanks for this great plugin!