Playback Stopped Time Reporting for Jellyfin

Feature description:

I use Jellyfin and jellyfin-plugin-listenbrainz, and I’d love if it would scrobble when I listen to a song in Symphonium.
Currently it does scrobble if I listen on the web, and doesn’t if I listen in Symphonium. I think what I am requesting is that the Playback Stopped event sent to Jellyfin contains the info on how much of the track was played, because currently the logs from my (Jellyfin) server look like

[2023-04-06 11:00:42.393 -04:00] [INF] [91] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app “Android” “13” playing “丸の内サディスティック”. Stopped at “unknown” ms

When I listen on the Web app, it looks like

[2023-04-04 08:45:39.736 -04:00] [INF] [129] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app “Jellyfin Web” “10.8.3” playing “Starting Act Cadenza/アドバタイズムービー”. Stopped at “31829” ms

Problem solved:

The scrobbling plugin on the server uses the ms count to check whether the play should be counted or not, and it won’t scrobble if it’s “unknown”.

Brought benefits:

The jellyfin-listenbrainz and jellyfin-lastfm plugins would scrobble when a song is listened in Symphonium.

Other application solutions:

A lot of other android apps that do playback from Jellyfin seem to have similar (or worse) problems. I was using FinAmp before, which has this issue and PR200 in that repo is a hacky unmerged fix, and Gelli has this issue.
Both are caused by reporting incorrect ms values in the Playback Stopped event.
I actually found Symphonium because I was looking for a player that didn’t have this issue, but now I like it and so I’m hoping this feature can be added.

I tried to add more links to code and issues but I can only have 2 per post

This is actually a limitation of that plugin and it should be reported to them.

Symfonium can handle offline plays and control the percent of marking played an media.

So the value is not send on stop on purpose, then a proper playcount increase with the lastplayed value is sent.

The plugin is supposed to get those too and handle them.

You can send them here if they want more details about why they should properly handle this use case.

Thanks so much for the response!

When you mention “a proper playcount increase with the lastplayed value is sent”, I assume you’re referring to the POST request to /Sessions/Playback/Stopped, correct? I don’t see any other requests in the logs, but perhaps there’s another type of request I’m not aware of or don’t know how to search for.

If that’s the only event Symfonium logs, it seems I might be out of luck. It’s unfortunate that there doesn’t appear to be a consensus between clients and server on who should enforce the minimum play duration for scrobbling.
For instance, both Feishin and Symfonium have configurable options for adjusting the minimum duration.

From the server side, I see that Jellyfin is happy to increment the play count even if the positionticks field is omitted (source).

However, the jellyfin-listenbrainz plugin intentionally disregards PlaybackStopped events without positionTicks, as it has its own configurable minimum duration for scrobbling and requires the play position to enforce it (source). From the plugin’s perspective, this seems to be the intended behavior.

Does that match your understanding? Is my only option here trying to convince the writer(s?) of jellyfin-listenbrainz that clients should enforce the minimum scrobble duration?

Symfonium calls the PlayedItems enpoint this is the normal endpoint to increase playcount with a lastplayed date.

When you play a media offline then come online apps are not supposed to send stopped since that would mark with a wrong date if online 3 days later. (And would require first a start and other calls to ensure everything might work or not, some plugins may actually expect you to play for the duration not just check the faked values sent)

In the same concept for apps to control when an item is marked played this is the proper way.

So those plugins should listen to that endpoint too and act accordingly.

For the record I send on purpose 0 so no Jellyfin does not increment playcount in Symfonium case. It’s incremented with the call to PlayedItems .

Thank you! That makes sense to me. I’ve created issue 25 on the plugin repository, which I cannot link to because the forum has flagged my posts as spam for having too many links. Hopefully the scrobbling on PlayedItems approach will work.

Just an update: lyarenei has made it work in PR 26 on the plugin repo (which I still unfortunately can’t link to).
Thanks for the help, and I’m glad to be able to use Symfonium :slight_smile:

The link Alternative listen recognition mode by lyarenei · Pull Request #26 · lyarenei/jellyfin-plugin-listenbrainz · GitHub