diff --git a/lib/screens/collection_detail_screen.dart b/lib/screens/collection_detail_screen.dart index 8c1415cb..e19f70f2 100644 --- a/lib/screens/collection_detail_screen.dart +++ b/lib/screens/collection_detail_screen.dart @@ -54,7 +54,6 @@ class _CollectionDetailScreenState extends BaseMediaListDetailScreen loadItems() async { - contentVersion++; await super.loadItems(); autoFocusFirstItemAfterLoad(); } diff --git a/lib/screens/playlist/playlist_detail_screen.dart b/lib/screens/playlist/playlist_detail_screen.dart index 93b8c274..fbca12e1 100644 --- a/lib/screens/playlist/playlist_detail_screen.dart +++ b/lib/screens/playlist/playlist_detail_screen.dart @@ -109,8 +109,6 @@ class _PlaylistDetailScreenState extends BaseMediaListDetailScreen loadItems() async { - // Increment content version when loading fresh content - contentVersion++; await super.loadItems(); // Auto-focus after load if in keyboard mode diff --git a/lib/screens/settings/settings_screen.dart b/lib/screens/settings/settings_screen.dart index 0adbe113..3e057f87 100644 --- a/lib/screens/settings/settings_screen.dart +++ b/lib/screens/settings/settings_screen.dart @@ -1300,7 +1300,7 @@ class _SettingsScreenState extends State with FocusableTab { await _settingsService.clearCache(); if (mounted) { navigator.pop(); - showSuccessSnackBar(context, t.settings.clearCacheSuccess); + showSuccessSnackBar(this.context, t.settings.clearCacheSuccess); } }, child: Text(t.common.clear), @@ -1327,7 +1327,7 @@ class _SettingsScreenState extends State with FocusableTab { await _keyboardService?.resetToDefaults(); if (mounted) { navigator.pop(); - showSuccessSnackBar(context, t.settings.resetSettingsSuccess); + showSuccessSnackBar(this.context, t.settings.resetSettingsSuccess); // Reload settings _loadSettings(); } @@ -1642,7 +1642,7 @@ class _KeyboardShortcutsScreenState extends State<_KeyboardShortcutsScreen> { await widget.keyboardService.resetToDefaults(); await _loadHotkeys(); if (mounted) { - showSuccessSnackBar(context, t.settings.shortcutsReset); + showSuccessSnackBar(this.context, t.settings.shortcutsReset); } }, child: Text(t.common.reset), @@ -1717,7 +1717,7 @@ class _KeyboardShortcutsScreenState extends State<_KeyboardShortcutsScreen> { navigator.pop(); showSuccessSnackBar( - context, + this.context, t.settings.shortcutUpdated(action: widget.keyboardService.getActionDisplayName(action)), ); } diff --git a/lib/screens/video_player_screen.dart b/lib/screens/video_player_screen.dart index 3236c4fb..e68e3094 100644 --- a/lib/screens/video_player_screen.dart +++ b/lib/screens/video_player_screen.dart @@ -777,6 +777,9 @@ class VideoPlayerScreenState extends State with WidgetsBindin Future _startPlayback() async { if (!mounted) return; + // Capture providers before async gaps + final offlineWatchService = widget.isOffline ? context.read() : null; + try { PlaybackInitializationResult result; Map? plexHeaders; @@ -810,9 +813,8 @@ class VideoPlayerScreenState extends State with WidgetsBindin // since the user may have watched further since downloading. Duration? resumePosition; if (widget.isOffline) { - final offlineWatchService = context.read(); final globalKey = '${widget.metadata.serverId}:${widget.metadata.ratingKey}'; - final localOffset = await offlineWatchService.getLocalViewOffset(globalKey); + final localOffset = await offlineWatchService!.getLocalViewOffset(globalKey); if (localOffset != null && localOffset > 0) { resumePosition = Duration(milliseconds: localOffset); appLogger.d('Resuming offline playback from local progress: ${localOffset}ms');