This commit is contained in:
1 parent
7463d3ee26
commit
3ad371aa9d
1 file changed
+5
-2
@@ -120,7 +120,9 @@ class DownloadController extends ChangeNotifier {
|
|||||||
String episodeId, {
|
String episodeId, {
|
||||||
DownloadLicense? license,
|
DownloadLicense? license,
|
||||||
}) async {
|
}) async {
|
||||||
if (_downloading.contains(episodeId)) return const DownloadActionResult(ok: true);
|
if (_downloading.contains(episodeId)) {
|
||||||
|
return const DownloadActionResult(ok: true);
|
||||||
|
}
|
||||||
final source = license ?? _licenseFor(episodeId);
|
final source = license ?? _licenseFor(episodeId);
|
||||||
if (source == null) return const DownloadActionResult(ok: false);
|
if (source == null) return const DownloadActionResult(ok: false);
|
||||||
_beginDownload(episodeId);
|
_beginDownload(episodeId);
|
||||||
@@ -129,7 +131,8 @@ class DownloadController extends ChangeNotifier {
|
|||||||
final media = await _storage.download(
|
final media = await _storage.download(
|
||||||
episodeId: episodeId,
|
episodeId: episodeId,
|
||||||
url: resolved,
|
url: resolved,
|
||||||
onProgress: (received, total) => _onProgress(episodeId, received, total),
|
onProgress: (received, total) =>
|
||||||
|
_onProgress(episodeId, received, total),
|
||||||
);
|
);
|
||||||
_localPaths[episodeId] = media.filePath;
|
_localPaths[episodeId] = media.filePath;
|
||||||
_progress[episodeId] = 1;
|
_progress[episodeId] = 1;
|
||||||
|
|||||||
Reference in new issue
Block a user