From 1e09d69507978710c8ce89f8a77a6e7d00468e2a Mon Sep 17 00:00:00 2001 From: nyne Date: Mon, 30 Dec 2024 21:58:23 +0800 Subject: [PATCH] improve cbz export --- lib/pages/local_comics_page.dart | 3 ++- lib/utils/cbz.dart | 1 + pubspec.yaml | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/pages/local_comics_page.dart b/lib/pages/local_comics_page.dart index d82f09b..a8a0794 100644 --- a/lib/pages/local_comics_page.dart +++ b/lib/pages/local_comics_page.dart @@ -404,8 +404,9 @@ class _LocalComicsPageState extends State { var file = await CBZ.export(c); await saveFile(filename: file.name, file: file); await file.delete(); - } catch (e) { + } catch (e, s) { context.showMessage(message: e.toString()); + Log.error("CBZ Export", e, s); } controller.close(); }), diff --git a/lib/utils/cbz.dart b/lib/utils/cbz.dart index 4116217..7001da9 100644 --- a/lib/utils/cbz.dart +++ b/lib/utils/cbz.dart @@ -208,6 +208,7 @@ abstract class CBZ { ), ); var cbz = File(FilePath.join(App.cachePath, sanitizeFileName('${comic.title}.cbz'))); + if (cbz.existsSync()) cbz.deleteSync(); await _compress(cache.path, cbz.path); cache.deleteSync(recursive: true); return cbz; diff --git a/pubspec.yaml b/pubspec.yaml index 32e6075..7fb2bbf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: flutter_qjs: git: url: https://github.com/wgh136/flutter_qjs - ref: 1657f62fe7545ac43a339e0a5ee2b82bacd81e9f + ref: 9c99ac258a11f8e91761a5466a190efba3ca64af crypto: ^3.0.6 dio: ^5.7.0 html: ^0.15.5 @@ -51,7 +51,7 @@ dependencies: sliver_tools: ^0.2.12 flutter_file_dialog: ^3.0.2 file_selector: ^1.0.3 - zip_flutter: ^0.0.5 + zip_flutter: ^0.0.6 lodepng_flutter: git: url: https://github.com/venera-app/lodepng_flutter