mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
Fixed the issue where the images of multi-chapter comic are downloaded to invalid folder.
This commit is contained in:
@@ -146,14 +146,19 @@ class ImagesDownloadTask extends DownloadTask with _TransferSpeedMixin {
|
|||||||
|
|
||||||
String? _cover;
|
String? _cover;
|
||||||
|
|
||||||
|
/// All images to download, key is chapter name
|
||||||
Map<String, List<String>>? _images;
|
Map<String, List<String>>? _images;
|
||||||
|
|
||||||
|
/// Downloaded image count
|
||||||
int _downloadedCount = 0;
|
int _downloadedCount = 0;
|
||||||
|
|
||||||
|
/// Total image count
|
||||||
int _totalCount = 0;
|
int _totalCount = 0;
|
||||||
|
|
||||||
|
/// Current downloading image index
|
||||||
int _index = 0;
|
int _index = 0;
|
||||||
|
|
||||||
|
/// Current downloading chapter, index of [_images]
|
||||||
int _chapter = 0;
|
int _chapter = 0;
|
||||||
|
|
||||||
var tasks = <int, _ImageDownloadWrapper>{};
|
var tasks = <int, _ImageDownloadWrapper>{};
|
||||||
@@ -180,10 +185,10 @@ class ImagesDownloadTask extends DownloadTask with _TransferSpeedMixin {
|
|||||||
if (comic!.chapters != null) {
|
if (comic!.chapters != null) {
|
||||||
saveTo = Directory(FilePath.join(
|
saveTo = Directory(FilePath.join(
|
||||||
path!,
|
path!,
|
||||||
comic!.chapters!.keys.elementAt(_chapter),
|
_images!.keys.elementAt(_chapter),
|
||||||
));
|
));
|
||||||
if (!saveTo.existsSync()) {
|
if (!saveTo.existsSync()) {
|
||||||
saveTo.createSync();
|
saveTo.createSync(recursive: true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
saveTo = Directory(path!);
|
saveTo = Directory(path!);
|
||||||
|
Reference in New Issue
Block a user