show mark as unwatched for mid progress items
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user