From 3921b2304d81c3a1fc06ef7f6b12e260c9ccb242 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Wed, 12 Nov 2025 20:30:11 +0800 Subject: [PATCH] opt download task Signed-off-by: bggRGjQaUbCoE --- lib/services/download/download_service.dart | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/services/download/download_service.dart b/lib/services/download/download_service.dart index 136652529..56a421ad2 100644 --- a/lib/services/download/download_service.dart +++ b/lib/services/download/download_service.dart @@ -358,6 +358,10 @@ class DownloadService extends GetxService { Future _startDownload(BiliDownloadEntryInfo entry) async { try { + if (!await downloadDanmaku(entry: entry)) { + return; + } + _updateCurStatus(DownloadStatus.getPlayUrl); final BiliDownloadMediaInfo mediaFileInfo = @@ -373,15 +377,10 @@ class DownloadService extends GetxService { await videoDir.create(recursive: true); } - final coverTask = _downloadCover(entry: entry); - - if (!await downloadDanmaku(entry: entry)) { - return; - } final mediaJsonFile = File(path.join(videoDir.path, _indexFile)); await Future.wait([ mediaJsonFile.writeAsString(jsonEncode(mediaFileInfo.toJson())), - coverTask, + _downloadCover(entry: entry), ]); if (curDownload.value?.cid != entry.cid) {