show mark as unwatched for mid progress items

This commit is contained in:
Amy Jeanes
2026-02-17 01:24:07 +00:00
parent 223a5d2219
commit 56b7cb842e
2 changed files with 15 additions and 3 deletions
+7
View File
@@ -382,6 +382,13 @@ class PlexMetadata with MultiServerFields {
return false;
}
/// Returns true if this item has started but not finished playback
/// Only applicable for individual items (movies, episodes)
bool get hasActiveProgress {
if (duration == null || viewOffset == null) return false;
return viewOffset! > 0 && viewOffset! < duration!;
}
// Helper to determine if content is watched
bool get isWatched {
// For series/seasons, check if all episodes are watched
+8 -3
View File
@@ -130,7 +130,12 @@ class MediaContextMenuState extends State<MediaContextMenu> {
metadata!.viewedLeafCount != null &&
metadata.leafCount != null &&
metadata.viewedLeafCount! > 0 &&
metadata.viewedLeafCount! < widget.item.leafCount!;
metadata.viewedLeafCount! < metadata.leafCount!;
final hasActiveProgress =
mediaType != null &&
(mediaType == PlexMediaType.movie || mediaType == PlexMediaType.episode) &&
metadata?.hasActiveProgress == true;
// Check if we should use bottom sheet (on iOS and Android)
final useBottomSheet = Platform.isIOS || Platform.isAndroid;
@@ -154,14 +159,14 @@ class MediaContextMenuState extends State<MediaContextMenu> {
// Regular menu items for other types
// Mark as Watched
if (!metadata!.isWatched || isPartiallyWatched) {
if (!metadata!.isWatched || isPartiallyWatched || hasActiveProgress) {
menuActions.add(
_MenuAction(value: 'watch', icon: Symbols.check_circle_outline_rounded, label: t.mediaMenu.markAsWatched),
);
}
// Mark as Unwatched
if (metadata.isWatched || isPartiallyWatched) {
if (metadata.isWatched || isPartiallyWatched || hasActiveProgress) {
menuActions.add(
_MenuAction(
value: 'unwatch',