Jellyfin Playback Reporting not working correctly

Issue description:

First of all: this is in no way hate on Symfonium, I just purchased it and think it is an incredible app, a real upgrade compared to Musicolet. So a big thank you for creating it! Look at it as constructive feedback :slight_smile:

Secondly, I think I accidentally uploaded the screenshots attached in this post as logs or something, for which I apologize.

Jellyfin version: 10.9.11
Playback Reporting Plugin version: 15.0.0.0
Symfonium version: 11.3.0 (127234)

So I saw an issue that was kind of related to this one here:

I first thought I had the same issue, but it seems this one is a little different. Symfonium seems to not correctly notify Jellyfin about media started playing and stopped playing. This causes the playback reporting plugin to display the wrong number of plays and wrong playtime.
I’ve noticed that whenever you start a new song, playlist,… manually that Symfonium reports it correctly to the Jellyfin server (and the playback reporting plugin), but not for the songs that come after the first. Jellyfin shows that the songs are playing, but they are for some reason not correctly reported to the Playback Reporting plugin.

Logs:

Upload description: tokkes

Additional information:

 
The first screenshot shows how the activity log looks when playing music with Finamp, for which the Playback Reporting plugin works correctly. The second screenshot is how the activity log looks when playing music using Symfonium.
 

Reproduction steps:

 
Reproduction steps:
Start playing a playlist. The first song playing will be reported correctly to Playback Reporting plugin through jellyfin, but after the first song it seems that the Playback Reporting plugin does not correctly register playcount and playtime anymore (unlike finamp, which works correctly with the plugin).
 

Media provider:

Jellyfin

Screenshots:

 

    

There’s many well know jellyfin side issues with reporting and the plugins that tries to work.

Symfonium being offline first use directly the proper endpoints and some plugins does not properly handle the often bad events Jellyfin sends about the timestamps.

See for example Scrobble when receiving a request to the PlayedItems endpoint · Issue #25 · lyarenei/jellyfin-plugin-listenbrainz · GitHub

AFAIK Jellyfin still bugs with the timezones in quite a few cases.

In your logs:

2024-10-18 22:56:34.587 Verbose JellyfinLogger  --> [274] POST http://192.168.0.113:8096/Users/a5e955b7bfe14d0097fc2e5c0abdf26d/PlayedItems/df381addddf455344f4a56097e372f6b?datePlayed=20241018205634 (31-byte body)
2024-10-18 22:56:34.597 Verbose JellyfinLogger  <-- [274] 200 OK http://192.168.0.113:8096/Users/a5e955b7bfe14d0097fc2e5c0abdf26d/PlayedItems/df381addddf455344f4a56097e372f6b?datePlayed=20241018205634 (10ms, unknown-length body)
2024-10-18 23:01:21.702 Verbose JellyfinLogger  --> [147] POST http://192.168.0.113:8096/Users/a5e955b7bfe14d0097fc2e5c0abdf26d/PlayedItems/3dc4a010f81789e9846088ca825e5ee3?datePlayed=20241018210121 (31-byte body)
2024-10-18 23:01:21.732 Verbose JellyfinLogger  <-- [147] 200 OK http://192.168.0.113:8096/Users/a5e955b7bfe14d0097fc2e5c0abdf26d/PlayedItems/3dc4a010f81789e9846088ca825e5ee3?datePlayed=20241018210121 (15ms, unknown-length body)
2024-10-18 23:04:53.192 Verbose JellyfinLogger  --> [111] POST http://192.168.0.113:8096/Users/a5e955b7bfe14d0097fc2e5c0abdf26d/PlayedItems/da267ca30d055d09d75cfe0d3e8a59ef?datePlayed=20241018210453 (31-byte body)
2024-10-18 23:04:53.213 Verbose JellyfinLogger  <-- [111] 200 OK http://192.168.0.113:8096/Users/a5e955b7bfe14d0097fc2e5c0abdf26d/PlayedItems/da267ca30d055d09d75cfe0d3e8a59ef?datePlayed=20241018210453 (20ms, unknown-length body)

Symfonium have properly only sent 3 playcount increase with the proper dates.
The other events are sent to be displayed on the dashboard but according to the API specs should not increase the playcounts with the values I pass.

So it seems this is the same as the other plugins and needs to be handled properly plugin side.

But I don’t understand the reason this doesn’t work properly with Symfonium but it does with Finamp. If Finamp manages to do it the right way, shouldn’t Symfonium be able to do it as well? Or is it related to the offline-first nature of Symfonium?

I think that’s what I just explained before yes :wink:

  1. Symfonium properly report playbacks of media when you are not connected and connecting back.
  2. Symfonium offers full controls over when playcount are increased and resume points are created.

So it uses the proper API calls to manually manage this. And it works.

Then some users want to see playbacks in the dashboard when connected so Symfonium also sends the events in those case to display there but with the proper parameters so that it’s not counted as playbacks to still give the control to the user.

Thank you for the quick replies!

I will investigate a little further on my own to see if I can fix it one way or another or know better what is going on. If I do then I’ll let you know :slight_smile:

So, to experiment a little further, I went ahead and did the following steps in both Finamp and Symfonium. Before doing that, I deleted all downloaded songs in both apps to make sure they were streamed directly from Jellyfin.

  1. Force stop the app
  2. Open the app
  3. Open playlist “All Out 2010s” (in which the songs are ordered the same for both apps)
  4. Start playing the playlist, the first song is Youngblood - 5 Seconds of Summer. Let both apps finish playing the song
  5. The next song, Skyfall - Adele: pause at 2 min and resume after about 10s. Let it play until the end and automatically go to the next song
  6. Next song is Faded - Alan Walker: let it play till 1:30 and then press the next button to go to the next song.
  7. Next song is Let Me Down Slowly - Alec Benjamin: pause it at 1m
  8. Exit the app, remove it from the recent app list & force stop it

So with these steps followed for both apps, the Jellyfin logs can be compared much better.
For both these apps, I uploaded the logs on the website with description:
tokkes - Symfonium vs Finamp logs

I first wanted to paste them here but they’re about 250 lines in total.

To make the logs more easily to analyze, I put ">> " at the start of some lines (mainly in the Symfonium logs) that differ from the other app’s logs. at a certain point, I wrote “-- FROM HERE, THINGS GET REALLY DIFFERENT COMPARED TO THE FINAMP LOGS --” in the Symfonium logs, because at that point it was too difficult to clearly show the differences between the two.

 
Some points to look out for (in the Symfonium logs):

  • For the first song, it’s pretty much the same, just a little different at the end when playback stop is reported.
  • From the second song onwards, session_playing_id is suddenly empty and play_method “na” instead of DirectPlay like the first song & the statement that “Details do not match for play item”.
  • Another thing in the Symfonium logs that do not appear in the FInamp logs is multiple messages about Playback stop did not have a tracker.
  • Also, this message “Playback stop but TrackedPlaybackInfo not found! not storing activity in DB” is present in the Symfonium logs for every song except the first. I think the not storing in DB is a message from the playback reporting plugin.
  • And lastly, for example for the first song, the Symfonium logs say “Stopped at "0" ms” while the Finamp logs say “Stopped at "203447" ms” for the first song I played (which was not paused nor skipped, just fully played without interacting with the apps).

I think those are the main differences between the logs, and I hope this helps to clear up the issue I’m facing. And although Symfonium is offline-first, I still do not understand why it would be Jellyfin’s fault that the playback reporting is all messed up with Symfonium and not with Finamp when they are both streaming directly from the jellyfin server.

Asking the same question over and over will always get the same result you know that right ?

  1. No they are not always directly streaming from Jellyfin, just enable playback cache and Symfonium will play from it’s cache and not the server. (And of course all the offline playbacks)
  2. As said 3 times now, the playcount and resume points are managed by Symfonium and the user settings, so again different from Finamp. Symfonium properly send the playcounts and the resume points as desired by the user everything works from Symfonium and Jellyfin POV.
  3. Your plugin (Yes it’s a plugin), does try to get some events from Jellyfin to do things. That plugin only support one part of the API and not all it’s cases and not the rest of the API. I’ve sent you a link to another plugin that fixed it’s code to support the rest of the API.

So again, your issue is what the plugin does with the event it receives and tries to do, not with Jellyfin API calls Symfonium can make.

You can easily check, if you disable that plugin and play from Symfonium in all the case (Direct streaming, cache, offline, …) then the playcounts and lastplayed will always be properly updated in Jellyfin with the proper dates and the proper resume points as per the settings you configure in Symfonium.

So if Jellyfin always have the proper data and is always properly updated by Symfonium, why do you think it’s Symfonium fault if the plugin does not properly handle the Jellyfin state changes?

TL;DR;

  1. The plugin does not support the events for `/PlayedItems’ posts.
  2. Symfonium properly send events to update the dashboard but ensure that the playcounts and resume points are not updated.
  3. The plugin does not properly understand that and tries to do things and fails.

Conclusion, the plugin should be updated to support stopping playback at 0 position and the post to PlayedItems endpoint as per the Jellyfin API surface.

I’m sorry it seemed like I asked the same question over and over. My main intention was to get a more clear answer of the reason for the difference between Symfonium and Finamp.

As an answer on this matter, is there a setting that works better with Jellyfin (in my case)?

Thank you for explaining this further, now it’s more clear to me why the plugin fails to correctly report the playback info.

I alse disabled the plugin as you said, checked the logs and saw that (almost) all the events in the logs I uploaded were not present anymore. I thought these logs came from Jellyfin itself, not the plugin (I should’ve checked this, so my bad).

So since the dashboard correctly shows which song is playing and the current play time of that song, I should be able to make my own Jellyfin plugin that can report detailed cumulative playtime and number of plays etc. over a period of time?

What does not work correctly in Jellyfin?
You can configure at what percentage a file is considered played and minimal time to set a resume point.

But again, all works correctly from Symfonium and Jellyfin POV. Your playcounts, resume points and last played values are correct in all the cases supported by Symfonium. (If not then it’s something I should fix, but not aware of any issues with that)

I know the plugins do no always get the proper data from Jellyfin so I don’t know but in theory yes. Triple check the data you get and the timezones I doubt they fixed this.

Alright, thank you for your patience while answering all my questions. Should I mark one of your responses as solution or what do I do now?

 

I don’t really know so nevermind that question.

No need to mark as solution since there’s no real issue related to the title.

1 Like