From 97f1b25ae9788d1d45f224f269fccebd0da9e188 Mon Sep 17 00:00:00 2001 From: Ming Ming Date: Mon, 18 Nov 2024 01:32:54 +0800 Subject: [PATCH] Fix wrong mime types used when counting file w/o metadata --- app/lib/controller/metadata_controller.dart | 2 +- app/lib/entity/file_util.dart | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/lib/controller/metadata_controller.dart b/app/lib/controller/metadata_controller.dart index 2d280801..03d452b4 100644 --- a/app/lib/controller/metadata_controller.dart +++ b/app/lib/controller/metadata_controller.dart @@ -67,7 +67,7 @@ class MetadataController { try { final missingCount = await _c.npDb.countFilesByMissingMetadata( account: account.toDb(), - mimes: file_util.supportedImageFormatMimes, + mimes: file_util.metadataSupportedFormatMimes, ownerId: account.userId.toCaseInsensitiveString(), ); _log.info("[_startMetadataTask] Missing count: $missingCount"); diff --git a/app/lib/entity/file_util.dart b/app/lib/entity/file_util.dart index 2eb5453c..940477a6 100644 --- a/app/lib/entity/file_util.dart +++ b/app/lib/entity/file_util.dart @@ -27,7 +27,7 @@ bool isSupportedVideoFormat(FileDescriptor file) => isSupportedVideoMime(file.fdMime ?? ""); bool isMetadataSupportedMime(String mime) => - _metadataSupportedFormatMimes.contains(mime); + metadataSupportedFormatMimes.contains(mime); bool isMetadataSupportedFormat(FileDescriptor file) => isMetadataSupportedMime(file.fdMime ?? ""); @@ -138,7 +138,7 @@ final supportedImageFormatMimes = final supportedVideoFormatMimes = supportedFormatMimes.where((f) => f.startsWith("video/")).toList(); -const _metadataSupportedFormatMimes = [ +const metadataSupportedFormatMimes = [ "image/jpeg", "image/heic", ];