jarnedemeulemeester / findroid

Third-party native Jellyfin Android app
GNU General Public License v3.0
2.67k stars 167 forks source link

Ending playback not being reported #869

Closed loafeyee closed 3 weeks ago

loafeyee commented 3 weeks ago

Describe your issue

Whilst watching a series and autoplaying to the next episode, the previous episode isn't reported as "stopped"

Steps to reproduce

  1. Play an episode from a series, ensure there's a proceeding episode after it
  2. Skip to part where Findroid plays the next episode (i.e. autoplays)

Expected behavior

Playback should be reported by the app and where it stopped In the logs, it should say something along the lines of:

Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app "Findroid" "1.11.1" playing "Jellyfin - S01E12". Stopped at "XXX" ms

Screenshots

image

Two episodes are missing/not tracked on external website Anilist using the jellyfin-ani-sync because Findroid did not report them, specifically the episode's ending.

(The 7–10 episodes weren't watched with Findroid with Jellyfin Media Player) (The 10–12 episodes were watched with Findroid and are missing because of lack of reporting, however Findroid did report at the final episode hence the "Completed" )

Player

mpv

Additional context

I am running the server on Windows Jellyfin version: 10.10.0

Some Jellyfin plugins rely on session manager. Like scrobblers or trackers to send watched episodes outside Jellyfin.

Normally, once a show is finished, playback is recorded like shown below:

Desktop Jellyfin Media Player:

[2024-10-26 16:42:59.447 -06:00] [INF] [27] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: session.RemoteEndPoint : "::1"
[2024-10-26 16:42:59.447 -06:00] [INF] [27] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : event_playing_id     = "c0a3a7675d04c9e0c3e03dfaeb6e118b"
[2024-10-26 16:42:59.448 -06:00] [INF] [27] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : event_user_id        = "ecb1d233efc14edeb81bfe2a23b3391a"
[2024-10-26 16:42:59.449 -06:00] [INF] [27] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : event_user_id_int    = 1
[2024-10-26 16:42:59.449 -06:00] [INF] [27] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : session_playing_id   = "c0a3a7675d04c9e0c3e03dfaeb6e118b"
[2024-10-26 16:42:59.450 -06:00] [INF] [27] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : session_user_id      = "ecb1d233efc14edeb81bfe2a23b3391a"
[2024-10-26 16:42:59.451 -06:00] [INF] [27] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : play_method          = "DirectPlay"
[2024-10-26 16:42:59.452 -06:00] [INF] [27] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : e.ClientName         = "Jellyfin Media Player"
[2024-10-26 16:42:59.452 -06:00] [INF] [27] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : e.DeviceName         = "User's Jellyfin"
[2024-10-26 16:42:59.453 -06:00] [INF] [27] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : ItemName             = "Mob Psycho 100 - s03e11 - Mob 3 ~Trauma~"
[2024-10-26 16:42:59.453 -06:00] [INF] [27] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : ItemId               = "c0a3a7675d04c9e0c3e03dfaeb6e118b"
[2024-10-26 16:42:59.454 -06:00] [INF] [27] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : ItemType             = "Episode"
[2024-10-26 16:42:59.455 -06:00] [INF] [27] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : All matches, playback registered
[2024-10-26 16:42:59.456 -06:00] [INF] [27] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: Saving playback tracking activity in DB
[2024-10-26 16:42:59.462 -06:00] [INF] [27] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : Exited
[2024-10-26 16:43:09.221 -06:00] [INF] [53] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app "Jellyfin Media Player" "1.11.1" playing "Mob 3 ~Trauma~". Stopped at "1420043" ms

Here's the android Jellyfin app directly connected to PC using private IP Address w/ transcode

Jellyfin Android:

[2024-10-26 16:58:45.111 -06:00] [INF] [56] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: session.RemoteEndPoint : "XXX.XX.X.XXX"
[2024-10-26 16:58:45.112 -06:00] [INF] [56] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : event_playing_id     = "c0a3a7675d04c9e0c3e03dfaeb6e118b"
[2024-10-26 16:58:45.113 -06:00] [INF] [56] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : event_user_id        = "ecb1d233efc14edeb81bfe2a23b3391a"
[2024-10-26 16:58:45.114 -06:00] [INF] [56] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : event_user_id_int    = 1
[2024-10-26 16:58:45.115 -06:00] [INF] [56] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : session_playing_id   = "c0a3a7675d04c9e0c3e03dfaeb6e118b"
[2024-10-26 16:58:45.116 -06:00] [INF] [56] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : session_user_id      = "ecb1d233efc14edeb81bfe2a23b3391a"
[2024-10-26 16:58:45.117 -06:00] [INF] [56] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : play_method          = "Transcode (v:h264 a:direct)"
[2024-10-26 16:58:45.118 -06:00] [INF] [56] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : e.ClientName         = "Jellyfin Android"
[2024-10-26 16:58:45.119 -06:00] [INF] [56] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : e.DeviceName         = "User's Phone"
[2024-10-26 16:58:45.120 -06:00] [INF] [56] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : ItemName             = "Mob Psycho 100 - s03e11 - Mob 3 ~Trauma~"
[2024-10-26 16:58:45.121 -06:00] [INF] [56] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : ItemId               = "c0a3a7675d04c9e0c3e03dfaeb6e118b"
[2024-10-26 16:58:45.122 -06:00] [INF] [56] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : ItemType             = "Episode"
[2024-10-26 16:58:45.123 -06:00] [INF] [56] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : All matches, playback registered
[2024-10-26 16:59:01.455 -06:00] [INF] [20] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app "Jellyfin Android" "2.6.2" playing "Mob 3 ~Trauma~". Stopped at "1422629" ms

However, Findroid is not reporting Playback stopped reported by app.

Findroid:

[2024-10-26 16:48:41.672 -06:00] [INF] [20] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: session.RemoteEndPoint : "XXX.XX.X.XXX"
[2024-10-26 16:48:41.672 -06:00] [INF] [20] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : event_playing_id     = "c0a3a7675d04c9e0c3e03dfaeb6e118b"
[2024-10-26 16:48:41.673 -06:00] [INF] [20] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : event_user_id        = "ecb1d233efc14edeb81bfe2a23b3391a"
[2024-10-26 16:48:41.674 -06:00] [INF] [20] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : event_user_id_int    = 1
[2024-10-26 16:48:41.675 -06:00] [INF] [20] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : session_playing_id   = "c0a3a7675d04c9e0c3e03dfaeb6e118b"
[2024-10-26 16:48:41.675 -06:00] [INF] [20] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : session_user_id      = "ecb1d233efc14edeb81bfe2a23b3391a"
[2024-10-26 16:48:41.676 -06:00] [INF] [20] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : play_method          = "DirectPlay"
[2024-10-26 16:48:41.677 -06:00] [INF] [20] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : e.ClientName         = "Findroid"
[2024-10-26 16:48:41.677 -06:00] [INF] [20] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : e.DeviceName         = "User's phone"
[2024-10-26 16:48:41.678 -06:00] [INF] [20] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : ItemName             = "Mob Psycho 100 - s03e11 - Mob 3 ~Trauma~"
[2024-10-26 16:48:41.679 -06:00] [INF] [20] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : ItemId               = "c0a3a7675d04c9e0c3e03dfaeb6e118b"
[2024-10-26 16:48:41.679 -06:00] [INF] [20] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : ItemType             = "Episode"
[2024-10-26 16:48:41.680 -06:00] [INF] [20] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : All matches, playback registered
[2024-10-26 16:48:41.681 -06:00] [INF] [20] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: Saving playback tracking activity in DB
[2024-10-26 16:48:41.687 -06:00] [INF] [20] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : Exited

I've tested this with other shows and episodes, but to no avail. I've also had the same problem in Jellyfin 1.09.11 too.

Surprisingly, playback does get called out at the end of a series. When there are no episodes left to play:

[2024-10-26 15:19:43.905 -06:00] [INF] [37] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app "Findroid" "0.15.3" playing "Confession ~The Future~". Stopped at "1420000" ms

However, it's not perfectly accurate and is rounded down. Not entirely sure if this contributes to anything tho.

[2024-10-26 17:39:29.773 -06:00] [INF] [57] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app "Jellyfin MPV Shim" "2.8.0" playing "Confession ~The Future~". Stopped at "1421700" ms

Device

Samsung Galaxy S24 U

Android version

14

App version

v0.15.3

Jellyfin version

10.10.0

jarnedemeulemeester commented 3 weeks ago

Thanks for the detailed report!

I just pushed a commit that should now report the item as stopped to Jellyfin. This however only works when auto transitioning to the next item. Using the skip back / forward button will not yet report the item as stopped.

That last one will require a bit more work :slightly_smiling_face:

loafeyee commented 3 weeks ago

Tysm for the quick fix!

I've run your test build, and it seems to work flawlessly now with the aforementioned tracking plugins.

Findroid Debug (autoplaying into the next episode):

##### Client recognized
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: session.RemoteEndPoint : "XXX.XX.X.XXX"
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : event_playing_id     = "bcc311fd59b7ca240874d51e19753f5a"
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : event_user_id        = "85272e272daf44c593c109028af204f6"
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : event_user_id_int    = 13
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : session_playing_id   = "bcc311fd59b7ca240874d51e19753f5a"
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : session_user_id      = "85272e272daf44c593c109028af204f6"
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : play_method          = "DirectPlay"
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : e.ClientName         = "Findroid Debug"
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : e.DeviceName         = "Debug Thingiemajig"
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : ItemName             = "Love, Chunibyo & Other Delusions! - s01e07 - Reminiscences... of Paradise Lost"
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : ItemId               = "bcc311fd59b7ca240874d51e19753f5a"
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : ItemType             = "Episode"
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : All matches, playback registered
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: Playback tracker found, adding playback info : "1067c509166bd049-85272e272daf44c593c109028af204f6-bcc311fd59b7ca240874d51e19753f5a"
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: Saving playback tracking activity in DB
[60] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : Exited
[8] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: Processing playback tracker : "1067c509166bd049-85272e272daf44c593c109028af204f6-bcc311fd59b7ca240874d51e19753f5a"
##### Thingie reported...
[57] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app "Findroid Debug" "0.15.3" playing "Reminiscences... of Paradise Lost". Stopped at "1537000" ms
##### Works correctly with tracking plugin! Huzzah!
[57] jellyfin_ani_sync.UpdateProviderStatus: The user 85272e27-2daf-44c5-93c1-09028af204f6 does not exist in the plugins config file. Skipping

This however only works when auto transitioning to the next item. Using the skip back / forward button will not yet report the item as stopped.

Hmm... I'll open another issue, and I'll see what I can find.

Again, thanks for the fix!

I'll close this issue since it's fixed in the latest build.