From f0c5370e27180011249a7ee5740f2999d5e73051 Mon Sep 17 00:00:00 2001 From: itsb Date: Sun, 16 Aug 2026 09:09:18 -0500 Subject: [PATCH] Preserve unknown idle playback position --- Emby.Server.Implementations/Session/SessionManager.cs | 2 +- .../SessionManager/IdlePlaybackTests.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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();