From f11a99ce3241cfdf63e5338384a602c770c6d09e Mon Sep 17 00:00:00 2001 From: Chralu <contact@charly-caulet.net> 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 e9bb8c12..766a94c1 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, @@ -45,7 +45,7 @@ class MobileDownloadService extends DownloadService { required this.podcastService, }) { _downloadProgressSubscription = downloadManager.downloadProgress.listen( - (progress) async => await _downloadProgressLock.synchronized( + (progress) async => await _downloadLock.synchronized( () { downloadProgress.add(progress); _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<void> deleteDownload(Episode episode) async => _downloadProgressLock.synchronized(() async { + Future<void> 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) {