aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Library/VersionResumeData.cs
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-07-02 08:49:11 +0200
committerShadowghost <Ghost_of_Stone@web.de>2026-07-02 08:49:11 +0200
commit38f1d9749ee67f18264937807b2f5882e1421557 (patch)
tree0860e37b596ad2ce8dd60e135647df3659b6c5c6 /MediaBrowser.Controller/Library/VersionResumeData.cs
parent0fb042b7403ebd7578b696aba35ba0c582ccf6ba (diff)
Fix review comments
Diffstat (limited to 'MediaBrowser.Controller/Library/VersionResumeData.cs')
-rw-r--r--MediaBrowser.Controller/Library/VersionResumeData.cs19
1 files changed, 15 insertions, 4 deletions
diff --git a/MediaBrowser.Controller/Library/VersionResumeData.cs b/MediaBrowser.Controller/Library/VersionResumeData.cs
index 455fe739ce..772e2bf3a7 100644
--- a/MediaBrowser.Controller/Library/VersionResumeData.cs
+++ b/MediaBrowser.Controller/Library/VersionResumeData.cs
@@ -7,14 +7,17 @@ namespace MediaBrowser.Controller.Library
/// <summary>
/// The user data of the most recently played alternate version that should drive the completion state of a multi-version item.
/// </summary>
+ /// <param name="VersionId">The id of the version that owns <paramref name="UserData"/>.</param>
/// <param name="UserData">The resume version's user data.</param>
- public record VersionResumeData(UserItemData UserData)
+ public record VersionResumeData(Guid VersionId, UserItemData UserData)
{
/// <summary>
/// Merges the most recently played version's completion state into the supplied user data dto.
- /// Only completion (played) propagates to the primary; the in-progress resume position stays on
- /// the version that owns it, which is surfaced directly (e.g. in resume queries) so that playback
- /// always targets the correct version rather than resuming the primary at another version's offset.
+ /// Completion (played) propagates to the primary. An in-progress resume position stays on the version
+ /// that owns it, which is surfaced directly (e.g. in resume queries) so that playback always targets
+ /// the correct version rather than resuming the primary at another version's offset. When the movie was
+ /// finished on a different version, the primary's own stale resume position is cleared so it does not
+ /// render as "watched and resumable" at the same time.
/// </summary>
/// <param name="dto">The user data dto to update.</param>
public void ApplyTo(UserItemDataDto dto)
@@ -25,6 +28,14 @@ namespace MediaBrowser.Controller.Library
{
dto.LastPlayedDate = UserData.LastPlayedDate;
}
+
+ // A different version was finished (played, no resume position of its own) and is the most
+ // recently played: the whole movie is watched.
+ if (!VersionId.Equals(dto.ItemId) && UserData.Played && UserData.PlaybackPositionTicks <= 0)
+ {
+ dto.PlaybackPositionTicks = 0;
+ dto.PlayedPercentage = null;
+ }
}
}
}