This commit is contained in:
2024-05-27 12:14:37 +08:00
parent de2bc89cdf
commit 91b3076e35
4 changed files with 51 additions and 3 deletions

View File

@@ -74,8 +74,8 @@ Future<void> 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");
}
}

View File

@@ -234,7 +234,7 @@ class ImageCaches {
Future<void> 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<void> clear() async {