chore: format

This commit is contained in:
edde746
2026-02-15 23:13:33 +01:00
parent 77c124b528
commit 7d29d7ba45
5 changed files with 21 additions and 20 deletions
-1
View File
@@ -200,7 +200,6 @@ class DownloadProvider extends ChangeNotifier {
}
}
void _onProgressUpdate(DownloadProgress progress) {
appLogger.d('Progress update received: ${progress.globalKey} - ${progress.status} - ${progress.progress}%');
+5 -1
View File
@@ -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);
}
+1 -3
View File
@@ -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
+14 -12
View File
@@ -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
+1 -3
View File
@@ -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) {