removeFromWatched method
- Movie movie
Removes a movie from the watched list and saves to POD.
Implementation
Future<void> removeFromWatched(Movie movie) async {
// Only use MovieList - remove old TTL operations.
if (_watchedListId != null) {
final success =
await _movieListService.removeMovieFromList(_watchedListId!, movie);
if (success) {
// Update stream with fresh data from MovieList.
final movies = await getWatched(forceRefresh: true);
_watchedController.add(movies);
return;
} else {
debugPrint('❌ Failed to remove ${movie.title} from Watched MovieList');
}
}
// Fallback to old system if MovieList fails.
final watched = await getWatched();
watched.removeWhere((m) => m.id == movie.id);
await _saveWatchedToPod(watched);
_watchedController.add(watched);
}