From 619959c8be3fcb48daed0eec84a860c4a0e0faaf Mon Sep 17 00:00:00 2001 From: kodjomoustapha <107993382+kodjodevf@users.noreply.github.com> Date: Fri, 31 May 2024 09:43:57 +0100 Subject: [PATCH] fix delete chapters from gallery --- lib/modules/library/library_screen.dart | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/modules/library/library_screen.dart b/lib/modules/library/library_screen.dart index 9bf695fc..27db98d3 100644 --- a/lib/modules/library/library_screen.dart +++ b/lib/modules/library/library_screen.dart @@ -1182,12 +1182,22 @@ class _LibraryScreenState extends ConsumerState ); try { - if (await File( - "${mangaDir!.path}${chapter.name}.cbz") - .exists()) { - File("${mangaDir.path}${chapter.name}.cbz") - .deleteSync(); - } + try { + if (File( + "${mangaDir!.path}${chapter.name}.cbz") + .existsSync()) { + File("${mangaDir.path}${chapter.name}.cbz") + .deleteSync(); + } + } catch (_) {} + try { + if (File( + "${mangaDir!.path}${chapter.name}.mp4") + .existsSync()) { + File("${mangaDir.path}${chapter.name}.mp4") + .deleteSync(); + } + } catch (_) {} path!.deleteSync(recursive: true); } catch (_) {} isar.writeTxnSync(() {