chore: format
This commit is contained in:
@@ -200,7 +200,6 @@ class DownloadProvider extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void _onProgressUpdate(DownloadProgress progress) {
|
||||
appLogger.d('Progress update received: ${progress.globalKey} - ${progress.status} - ${progress.progress}%');
|
||||
|
||||
|
||||
@@ -1210,7 +1210,11 @@ class _MediaDetailScreenState extends State<MediaDetailScreen> with WatchStateAw
|
||||
final desiredOffset = (targetCenter - (viewport / 2)).clamp(0.0, _extrasScrollController.position.maxScrollExtent);
|
||||
|
||||
if (animate) {
|
||||
_extrasScrollController.animateTo(desiredOffset, duration: const Duration(milliseconds: 150), curve: Curves.easeOut);
|
||||
_extrasScrollController.animateTo(
|
||||
desiredOffset,
|
||||
duration: const Duration(milliseconds: 150),
|
||||
curve: Curves.easeOut,
|
||||
);
|
||||
} else {
|
||||
_extrasScrollController.jumpTo(desiredOffset);
|
||||
}
|
||||
|
||||
@@ -1555,9 +1555,7 @@ class DownloadManagerService {
|
||||
final showEpisodes = await _database.getEpisodesByShow(showKey);
|
||||
|
||||
// Check if any episodes belong to this show besides the current item
|
||||
return showEpisodes.any(
|
||||
(item) => item.globalKey != '${metadata.serverId}:${metadata.ratingKey}',
|
||||
);
|
||||
return showEpisodes.any((item) => item.globalKey != '${metadata.serverId}:${metadata.ratingKey}');
|
||||
}
|
||||
|
||||
/// Find file with any extension
|
||||
|
||||
@@ -118,18 +118,20 @@ class PlaybackProgressTracker {
|
||||
_resetBackoff();
|
||||
} else {
|
||||
// Fire-and-forget for playing/paused — avoid blocking the Dart event loop
|
||||
_sendOnlineProgress(state, position, duration).then((_) {
|
||||
_resetBackoff();
|
||||
}).catchError((Object e) {
|
||||
_consecutiveFailures++;
|
||||
// Exponential backoff: skip 1, 2, 4, 8... ticks (capped at 6 ≈ 60s)
|
||||
_ticksToSkip = (1 << (_consecutiveFailures - 1)).clamp(1, 6);
|
||||
appLogger.d(
|
||||
'Progress update failed ($_consecutiveFailures consecutive), '
|
||||
'skipping next $_ticksToSkip tick(s)',
|
||||
error: e,
|
||||
);
|
||||
});
|
||||
_sendOnlineProgress(state, position, duration)
|
||||
.then((_) {
|
||||
_resetBackoff();
|
||||
})
|
||||
.catchError((Object e) {
|
||||
_consecutiveFailures++;
|
||||
// Exponential backoff: skip 1, 2, 4, 8... ticks (capped at 6 ≈ 60s)
|
||||
_ticksToSkip = (1 << (_consecutiveFailures - 1)).clamp(1, 6);
|
||||
appLogger.d(
|
||||
'Progress update failed ($_consecutiveFailures consecutive), '
|
||||
'skipping next $_ticksToSkip tick(s)',
|
||||
error: e,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// Emit watch state event on stop for UI updates across screens
|
||||
|
||||
@@ -128,9 +128,7 @@ class PlexApiCache {
|
||||
/// Used by DownloadProvider to batch-load metadata on startup instead of
|
||||
/// issuing per-item DB queries.
|
||||
Future<Map<String, PlexMetadata>> getAllPinnedMetadata() async {
|
||||
final rows = await (_db.select(_db.apiCache)
|
||||
..where((t) => t.pinned.equals(true)))
|
||||
.get();
|
||||
final rows = await (_db.select(_db.apiCache)..where((t) => t.pinned.equals(true))).get();
|
||||
|
||||
final result = <String, PlexMetadata>{};
|
||||
for (final row in rows) {
|
||||
|
||||
Reference in New Issue
Block a user