fix(ui): refresh stale watch state
This commit is contained in:
@@ -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,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user