mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-01-11 22:40:36 +00:00
Refactor UChapDataPreloadExtensions to improve image byte retrieval logic
This commit is contained in:
parent
e9bbd2e1e3
commit
debbb26dbf
2 changed files with 5 additions and 5 deletions
BIN
assets/transparent.png
Normal file
BIN
assets/transparent.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
|
|
@ -48,7 +48,7 @@ extension UChapDataPreloadExtensions on UChapDataPreload {
|
|||
Uint8List? imageBytes;
|
||||
if (archiveImage != null) {
|
||||
imageBytes = archiveImage;
|
||||
} else if (isLocale!) {
|
||||
} else if (isLocale == true && directory != null && index != null) {
|
||||
imageBytes = File(
|
||||
p.join(directory!.path, "${padIndex(index!)}.jpg"),
|
||||
).readAsBytesSync();
|
||||
|
|
@ -56,10 +56,10 @@ extension UChapDataPreloadExtensions on UChapDataPreload {
|
|||
File? cachedImage;
|
||||
if (pageUrl != null) {
|
||||
cachedImage = await _getCachedImageFile(pageUrl!.url);
|
||||
}
|
||||
if (cachedImage == null) {
|
||||
await Future.delayed(const Duration(seconds: 3));
|
||||
cachedImage = await _getCachedImageFile(pageUrl!.url);
|
||||
if (cachedImage == null) {
|
||||
await Future.delayed(const Duration(seconds: 3));
|
||||
cachedImage = await _getCachedImageFile(pageUrl!.url);
|
||||
}
|
||||
}
|
||||
imageBytes = cachedImage?.readAsBytesSync();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue