mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-17 13:53:41 +00:00
feat(http): support advisory extension download sizes (#1599)
This commit is contained in:
17 files changed
+1047
-182
No files matched your search
@@ -126,7 +126,7 @@ class TaskRecord {
|
||||
IconData get icon => taskFileTypeIcon(name, isFolder: isFolder, protocol: protocol);
|
||||
|
||||
factory TaskRecord.fromApi(api_task.Task task) {
|
||||
final totalBytes = task.meta.res?.size ?? 0;
|
||||
final totalBytes = task.meta.res?.size ?? task.meta.opts.size;
|
||||
final downloadedBytes = task.progress.downloaded;
|
||||
final progress = totalBytes > 0 ? (downloadedBytes / totalBytes).clamp(0.0, 1.0) : null;
|
||||
final status = _statusFromApi(task.status);
|
||||
|
||||
Reference in new issue
Block a user