fix(ui): refresh stale watch state

This commit is contained in:
edde746
2026-05-09 06:00:36 +02:00
parent 3e6ebcdb6a
commit 7a3f63683e
21 changed files with 572 additions and 195 deletions
+15 -1
View File
@@ -4,7 +4,7 @@ import 'base_notifier.dart';
import 'global_key_utils.dart';
import 'hierarchical_event_mixin.dart';
enum WatchStateChangeType { watched, unwatched, progressUpdate }
enum WatchStateChangeType { watched, unwatched, progressUpdate, removedFromContinueWatching }
/// Event representing a watch state change with parent chain for hierarchical invalidation
class WatchStateEvent with HierarchicalEventMixin {
@@ -132,4 +132,18 @@ class WatchStateNotifier extends BaseNotifier<WatchStateEvent> {
),
);
}
/// Helper to emit a Continue Watching removal event.
void notifyRemovedFromContinueWatching({required MediaItem item}) {
notify(
WatchStateEvent(
itemId: item.id,
serverId: item.serverId ?? '',
changeType: WatchStateChangeType.removedFromContinueWatching,
parentChain: item.parentChain,
mediaType: item.kind.id,
librarySectionID: item.libraryId,
),
);
}
}