Skip to content

Commit

Permalink
amugofjava#94 renamed [MobileDownloadService] lock.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chralu committed Sep 17, 2023
1 parent c819a1e commit 49c5fd9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/services/download/mobile_download_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ 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,
required this.downloadManager,
required this.settingsService,
}) {
_downloadProgressSubscription = downloadManager.downloadProgress.listen(
(event) async => await _downloadProgressLock.synchronized(
(event) async => await _downloadLock.synchronized(
() {
downloadProgress.add(event);
_updateDownloadProgress(event);
Expand Down Expand Up @@ -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
Expand All @@ -135,7 +135,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) {
Expand Down

0 comments on commit 49c5fd9

Please sign in to comment.