diff --git a/lib/models/plex_metadata.dart b/lib/models/plex_metadata.dart index c8d27347..2e5a93a5 100644 --- a/lib/models/plex_metadata.dart +++ b/lib/models/plex_metadata.dart @@ -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 diff --git a/lib/widgets/media_context_menu.dart b/lib/widgets/media_context_menu.dart index 210efd77..381b8c36 100644 --- a/lib/widgets/media_context_menu.dart +++ b/lib/widgets/media_context_menu.dart @@ -130,7 +130,12 @@ class MediaContextMenuState extends State { 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 { // 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',