From 499e64b1c342bbab489407bb8059aa2684a12d8b Mon Sep 17 00:00:00 2001 From: itsb Date: Thu, 13 Aug 2026 16:41:45 -0500 Subject: Use client-reported position for idle playback cleanup --- Emby.Server.Implementations/Session/SessionManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Emby.Server.Implementations/Session/SessionManager.cs') diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index 5d62332552..cdd6cb4ce2 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -655,7 +655,7 @@ namespace Emby.Server.Implementations.Session ItemId = session.NowPlayingItem is null ? Guid.Empty : session.NowPlayingItem.Id, SessionId = session.Id, MediaSourceId = session.PlayState?.MediaSourceId, - PositionTicks = session.PlayState?.PositionTicks + PositionTicks = session.LastPlaybackCheckInPositionTicks ?? 0 }).ConfigureAwait(false); } catch (Exception ex) -- cgit v1.2.3 From f0c5370e27180011249a7ee5740f2999d5e73051 Mon Sep 17 00:00:00 2001 From: itsb Date: Sun, 16 Aug 2026 09:09:18 -0500 Subject: Preserve unknown idle playback position --- Emby.Server.Implementations/Session/SessionManager.cs | 2 +- .../SessionManager/IdlePlaybackTests.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Emby.Server.Implementations/Session/SessionManager.cs') diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index cdd6cb4ce2..f4aa0ad03a 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -655,7 +655,7 @@ namespace Emby.Server.Implementations.Session ItemId = session.NowPlayingItem is null ? Guid.Empty : session.NowPlayingItem.Id, SessionId = session.Id, MediaSourceId = session.PlayState?.MediaSourceId, - PositionTicks = session.LastPlaybackCheckInPositionTicks ?? 0 + PositionTicks = session.LastPlaybackCheckInPositionTicks }).ConfigureAwait(false); } catch (Exception ex) diff --git a/tests/Jellyfin.Server.Implementations.Tests/SessionManager/IdlePlaybackTests.cs b/tests/Jellyfin.Server.Implementations.Tests/SessionManager/IdlePlaybackTests.cs index 3540c9de10..7722707cbe 100644 --- a/tests/Jellyfin.Server.Implementations.Tests/SessionManager/IdlePlaybackTests.cs +++ b/tests/Jellyfin.Server.Implementations.Tests/SessionManager/IdlePlaybackTests.cs @@ -21,9 +21,9 @@ namespace Jellyfin.Server.Implementations.Tests.SessionManager; public class IdlePlaybackTests { [Theory] - [InlineData(null, 0)] + [InlineData(null, null)] [InlineData(123456789L, 123456789L)] - public async Task CheckForIdlePlayback_StopsAtLastClientReportedPosition(long? clientPositionTicks, long expectedPositionTicks) + public async Task CheckForIdlePlayback_StopsAtLastClientReportedPosition(long? clientPositionTicks, long? expectedPositionTicks) { var playbackStopped = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var eventManager = new Mock(); -- cgit v1.2.3