From 91b3076e35cdff2ed340f1984eab4fb25e8fa9ed Mon Sep 17 00:00:00 2001 From: lifegpc Date: Mon, 27 May 2024 12:14:37 +0800 Subject: [PATCH] Bug fix --- ios/Podfile.lock | 24 ++++++++++++++++++++++++ lib/globals.dart | 4 ++-- lib/platform/image_cache_io.dart | 2 +- macos/Podfile.lock | 24 ++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index d5a7d51..1ce5ba2 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -14,6 +14,21 @@ PODS: - shared_preferences_foundation (0.0.1): - Flutter - FlutterMacOS + - sqlite3 (3.46.0): + - sqlite3/common (= 3.46.0) + - sqlite3/common (3.46.0) + - sqlite3/fts5 (3.46.0): + - sqlite3/common + - sqlite3/perf-threadsafe (3.46.0): + - sqlite3/common + - sqlite3/rtree (3.46.0): + - sqlite3/common + - sqlite3_flutter_libs (0.0.1): + - Flutter + - sqlite3 (~> 3.46.0) + - sqlite3/fts5 + - sqlite3/perf-threadsafe + - sqlite3/rtree - super_native_extensions (0.0.1): - Flutter @@ -25,8 +40,13 @@ DEPENDENCIES: - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) + - sqlite3_flutter_libs (from `.symlinks/plugins/sqlite3_flutter_libs/ios`) - super_native_extensions (from `.symlinks/plugins/super_native_extensions/ios`) +SPEC REPOS: + trunk: + - sqlite3 + EXTERNAL SOURCES: cryptography_flutter: :path: ".symlinks/plugins/cryptography_flutter/ios" @@ -42,6 +62,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/path_provider_foundation/darwin" shared_preferences_foundation: :path: ".symlinks/plugins/shared_preferences_foundation/darwin" + sqlite3_flutter_libs: + :path: ".symlinks/plugins/sqlite3_flutter_libs/ios" super_native_extensions: :path: ".symlinks/plugins/super_native_extensions/ios" @@ -53,6 +75,8 @@ SPEC CHECKSUMS: package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 + sqlite3: 154b084339ede06960a5b3c8160066adc9176b7d + sqlite3_flutter_libs: 0d611efdf6d1c9297d5ab03dab21b75aeebdae31 super_native_extensions: 4916b3c627a9c7fffdc48a23a9eca0b1ac228fa7 PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796 diff --git a/lib/globals.dart b/lib/globals.dart index 2912f35..b1b9170 100644 --- a/lib/globals.dart +++ b/lib/globals.dart @@ -74,8 +74,8 @@ Future prepareImageCaches() async { _imageCaches = ImageCaches(); try { await _imageCaches!.init(); - } catch (e) { - _globalLog.warning("Failed to initiailzed image caches: $e"); + } catch (e, stack) { + _globalLog.warning("Failed to initiailzed image caches: $e\n$stack"); } } diff --git a/lib/platform/image_cache_io.dart b/lib/platform/image_cache_io.dart index 3aa12a1..64506ba 100644 --- a/lib/platform/image_cache_io.dart +++ b/lib/platform/image_cache_io.dart @@ -234,7 +234,7 @@ class ImageCaches { Future updateSize({bool clear = false}) async { if (clear) await _removeUnexist(); final re = await _db!.rawQuery("SELECT SUM(size) AS sizes FROM images;"); - _size = re[0]["sizes"] as int; + _size = re.isEmpty ? 0 : re[0]["sizes"] as int; } Future clear() async { diff --git a/macos/Podfile.lock b/macos/Podfile.lock index ddb8e99..decccb8 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -16,6 +16,21 @@ PODS: - shared_preferences_foundation (0.0.1): - Flutter - FlutterMacOS + - sqlite3 (3.46.0): + - sqlite3/common (= 3.46.0) + - sqlite3/common (3.46.0) + - sqlite3/fts5 (3.46.0): + - sqlite3/common + - sqlite3/perf-threadsafe (3.46.0): + - sqlite3/common + - sqlite3/rtree (3.46.0): + - sqlite3/common + - sqlite3_flutter_libs (0.0.1): + - FlutterMacOS + - sqlite3 (~> 3.46.0) + - sqlite3/fts5 + - sqlite3/perf-threadsafe + - sqlite3/rtree - super_native_extensions (0.0.1): - FlutterMacOS - window_manager (0.2.0): @@ -30,9 +45,14 @@ DEPENDENCIES: - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) - screen_retriever (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos`) - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) + - sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos`) - super_native_extensions (from `Flutter/ephemeral/.symlinks/plugins/super_native_extensions/macos`) - window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`) +SPEC REPOS: + trunk: + - sqlite3 + EXTERNAL SOURCES: cryptography_flutter: :path: Flutter/ephemeral/.symlinks/plugins/cryptography_flutter/macos @@ -50,6 +70,8 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos shared_preferences_foundation: :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin + sqlite3_flutter_libs: + :path: Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos super_native_extensions: :path: Flutter/ephemeral/.symlinks/plugins/super_native_extensions/macos window_manager: @@ -64,6 +86,8 @@ SPEC CHECKSUMS: path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38 shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 + sqlite3: 154b084339ede06960a5b3c8160066adc9176b7d + sqlite3_flutter_libs: 1be4459672f8168ded2d8667599b8e3ca5e72b83 super_native_extensions: 85efee3a7495b46b04befcfc86ed12069264ebf3 window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8