diff --git a/lib/model/collection_source.dart b/lib/model/collection_source.dart index 2f275dd83..751bcc51a 100644 --- a/lib/model/collection_source.dart +++ b/lib/model/collection_source.dart @@ -73,10 +73,12 @@ class CollectionSource { await entry.catalog(); if (entry.isCatalogued) { newMetadata.add(entry.catalogMetadata); + if (newMetadata.length >= 500) { + await metadataDb.saveMetadata(List.unmodifiable(newMetadata)); + newMetadata.clear(); + } } }); - if (newMetadata.isEmpty) return; - await metadataDb.saveMetadata(List.unmodifiable(newMetadata)); onCatalogMetadataChanged(); debugPrint('$runtimeType catalogEntries complete in ${stopwatch.elapsed.inSeconds}s with ${newMetadata.length} new entries'); diff --git a/lib/services/image_file_service.dart b/lib/services/image_file_service.dart index d4dbe37af..bf93a41dd 100644 --- a/lib/services/image_file_service.dart +++ b/lib/services/image_file_service.dart @@ -72,7 +72,7 @@ class ImageFileService { return Future.sync(() => Uint8List(0)); } - static Future getThumbnail(ImageEntry entry, int width, int height, {Object taskKey}) { + static Future getThumbnail(ImageEntry entry, int width, int height, {Object taskKey, int priority}) { return servicePolicy.call( () async { try { @@ -89,7 +89,7 @@ class ImageFileService { return Uint8List(0); }, // debugLabel: 'getThumbnail width=$width, height=$height entry=${entry.filenameWithoutExtension}', - priority: width == 0 || height == 0 ? ServiceCallPriority.getFastThumbnail : ServiceCallPriority.getSizedThumbnail, + priority: priority ?? (width == 0 || height == 0 ? ServiceCallPriority.getFastThumbnail : ServiceCallPriority.getSizedThumbnail), key: taskKey, ); } diff --git a/lib/utils/constants.dart b/lib/utils/constants.dart index 12c5a96a0..1c2f2652a 100644 --- a/lib/utils/constants.dart +++ b/lib/utils/constants.dart @@ -113,6 +113,12 @@ class Constants { licenseUrl: 'https://github.com/pinkfish/flutter_native_timezone/blob/master/LICENSE', sourceUrl: 'https://github.com/pinkfish/flutter_native_timezone', ), + Dependency( + name: 'Flutter Staggered Animations', + license: 'MIT', + licenseUrl: 'https://github.com/mobiten/flutter_staggered_animations/blob/master/LICENSE', + sourceUrl: 'https://github.com/mobiten/flutter_staggered_animations', + ), Dependency( name: 'Flutter SVG', license: 'MIT',