diff --git a/lib/services/download/mobile_download_service.dart b/lib/services/download/mobile_download_service.dart index c2a6c763..04c9c6a8 100644 --- a/lib/services/download/mobile_download_service.dart +++ b/lib/services/download/mobile_download_service.dart @@ -32,7 +32,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, @@ -40,7 +40,7 @@ class MobileDownloadService extends DownloadService { required this.settingsService, }) { _downloadProgressSubscription = downloadManager.downloadProgress.listen( - (event) async => await _downloadProgressLock.synchronized( + (event) async => await _downloadLock.synchronized( () { downloadProgress.add(event); _updateDownloadProgress(event); @@ -110,7 +110,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 @@ -135,7 +135,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) {