The Free Software Media System - Server Backend & API
Preserve unknown idle playback position
itsbf0c5370e2718
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.csindex 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.SessionItemId = 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.csindex 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<long?>(TaskCreationOptions.RunContinuationsAsynchronously);var eventManager = new Mock<IEventManager>();