mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-09 07:28:14 -07:00
fix: Downloads resetting with multiple active downloads (#606)
feat: Add sync count icon to menu bars
This commit is contained in:
parent
493f40645c
commit
d8f613de07
8 changed files with 105 additions and 67 deletions
|
|
@ -44,6 +44,11 @@ class BackgroundDownloader extends _$BackgroundDownloader {
|
|||
|
||||
if (status == TaskStatus.complete || status == TaskStatus.canceled) {
|
||||
ref.read(downloadTasksProvider(update.task.taskId).notifier).update((state) => DownloadStream.empty());
|
||||
ref
|
||||
.read(activeDownloadTasksProvider.notifier)
|
||||
.update((state) => state.where((element) => element.taskId != update.task.taskId).toList());
|
||||
|
||||
ref.read(syncProvider.notifier).cleanupTemporaryFiles();
|
||||
}
|
||||
case TaskProgressUpdate():
|
||||
final progress = update.progress;
|
||||
|
|
|
|||
|
|
@ -54,9 +54,10 @@ class SyncDownloadStatus extends _$SyncDownloadStatus {
|
|||
if (childItem.videoFile.existsSync()) {
|
||||
fullySyncedChildren++;
|
||||
}
|
||||
if (downloadStream.hasDownload) {
|
||||
if (downloadStream.isEnqueuedOrDownloading) {
|
||||
downloadCount++;
|
||||
fullProgress += downloadStream.progress;
|
||||
fullProgress += downloadStream.progress.clamp(0.0, 1.0);
|
||||
|
||||
mainStream = mainStream.copyWith(
|
||||
status: mainStream.status != TaskStatus.running ? downloadStream.status : mainStream.status,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue