diff options
| author | Cody Robibero <cody@robibe.ro> | 2026-08-18 17:12:00 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-18 17:12:00 -0400 |
| commit | 4a659fb30cbf220f2692a086e42b8a45211026fc (patch) | |
| tree | 81e4f9628f699b3cf163ecfa011010921e3cd23a /MediaBrowser.Controller | |
| parent | c203da245d03fa231a7f2d862458193f81063b5f (diff) | |
| parent | f0c5370e27180011249a7ee5740f2999d5e73051 (diff) | |
Merge pull request #17631 from itsb/fix/confirmed-resume-position-master
Use client-reported position for idle playback cleanup
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Session/SessionInfo.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index fb68bfb770..d9bc79dec5 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -28,6 +28,7 @@ namespace MediaBrowser.Controller.Session private readonly Lock _progressLock = new(); private Timer _progressTimer; private PlaybackProgressInfo _lastProgressInfo; + private long? _lastPlaybackCheckInPositionTicks; private bool _disposed; @@ -125,6 +126,22 @@ namespace MediaBrowser.Controller.Session public DateTime LastPlaybackCheckIn { get; set; } /// <summary> + /// Gets the position reported by the client at the last playback check-in. + /// </summary> + /// <value>The position ticks, or <see langword="null"/> if the client did not report a position.</value> + [JsonIgnore] + public long? LastPlaybackCheckInPositionTicks + { + get + { + lock (_progressLock) + { + return _lastPlaybackCheckInPositionTicks; + } + } + } + + /// <summary> /// Gets or sets the last paused date. /// </summary> /// <value>The last paused date.</value> @@ -372,6 +389,7 @@ namespace MediaBrowser.Controller.Session lock (_progressLock) { + _lastPlaybackCheckInPositionTicks = progressInfo.PositionTicks; _lastProgressInfo = progressInfo; if (_progressTimer is null) |
