From f03cbf93d6e19469a631347b656c0927230d864c Mon Sep 17 00:00:00 2001 From: Chralu Date: Sun, 17 Sep 2023 09:28:34 +0200 Subject: [PATCH] #94 renamed [MobileDownloadService] lock. --- lib/services/download/mobile_download_service.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/services/download/mobile_download_service.dart b/lib/services/download/mobile_download_service.dart index e2b889e1..54ae8784 100644 --- a/lib/services/download/mobile_download_service.dart +++ b/lib/services/download/mobile_download_service.dart @@ -36,7 +36,7 @@ class MobileDownloadService extends DownloadService { /// Lock ensures we wait for task creation and local save /// before handling subsequent [Download update events]. - final _downloadProgressLock = Lock(); + final _downloadLock = Lock(); MobileDownloadService({ required this.repository, @@ -46,7 +46,7 @@ class MobileDownloadService extends DownloadService { }) { downloadManager.downloadProgress.pipe(downloadProgress); _downloadProgressSubscription = downloadManager.downloadProgress.listen( - (progress) async => await _downloadProgressLock.synchronized( + (progress) async => await _downloadLock.synchronized( () { _updateDownloadProgress(progress); }, @@ -141,7 +141,7 @@ class MobileDownloadService extends DownloadService { /// the URL before calling download and ensure it is https. var url = await resolveUrl(episode.contentUrl!, forceHttps: true); - await _downloadProgressLock.synchronized(() async { + await _downloadLock.synchronized(() async { final taskId = await downloadManager.enqueueTask(url, downloadPath, filename!); // Update the episode with download data @@ -166,7 +166,7 @@ class MobileDownloadService extends DownloadService { } @override - Future deleteDownload(Episode episode) async => _downloadProgressLock.synchronized(() async { + Future deleteDownload(Episode episode) async => _downloadLock.synchronized(() async { // If this episode is currently downloading, cancel the download first. if (episode.downloadState == DownloadState.downloaded) { if (settingsService.markDeletedEpisodesAsPlayed) {