Windows PathNotFoundException fix

- Fixed the PathNotFoundException for Windows, which doesn't use "/" in directories, but "\".
(flutter: PathNotFoundException: Creation failed, path = 'C:\Users\User\AppData\Local\Temp\Mangayomi/cacheimagecover' (OS Error: Das System kann den angegebenen Pfad nicht finden.)
Instead of manually concatenating paths using string interpolation, it now uses the join function properly.
- Also fixed that the App was not able to create the directories by including recursive: true in the else statement.
This commit is contained in:
NBA2K1 2024-12-07 03:54:23 +01:00
parent 3fe8f4266d
commit 818857261d

View file

@ -192,7 +192,8 @@ class CustomExtendedNetworkImageProvider
) async {
final Directory cacheImagesDirectory = Directory(join(
(await getTemporaryDirectory()).path,
'Mangayomi/${imageCacheFolderName ?? "cacheimagecover"}'));
'Mangayomi',
imageCacheFolderName ?? 'cacheimagecover'));
Uint8List? data;
// exist, try to find cache image file
if (cacheImagesDirectory.existsSync()) {
@ -213,7 +214,7 @@ class CustomExtendedNetworkImageProvider
}
// create folder
else {
await cacheImagesDirectory.create();
await cacheImagesDirectory.create(recursive: true);
}
// load from network
if (data == null) {