Fix wrong mime types used when counting file w/o metadata

This commit is contained in:
Ming Ming 2024-11-18 01:32:54 +08:00
parent 4eab807524
commit 97f1b25ae9
2 changed files with 3 additions and 3 deletions

View file

@ -67,7 +67,7 @@ class MetadataController {
try { try {
final missingCount = await _c.npDb.countFilesByMissingMetadata( final missingCount = await _c.npDb.countFilesByMissingMetadata(
account: account.toDb(), account: account.toDb(),
mimes: file_util.supportedImageFormatMimes, mimes: file_util.metadataSupportedFormatMimes,
ownerId: account.userId.toCaseInsensitiveString(), ownerId: account.userId.toCaseInsensitiveString(),
); );
_log.info("[_startMetadataTask] Missing count: $missingCount"); _log.info("[_startMetadataTask] Missing count: $missingCount");

View file

@ -27,7 +27,7 @@ bool isSupportedVideoFormat(FileDescriptor file) =>
isSupportedVideoMime(file.fdMime ?? ""); isSupportedVideoMime(file.fdMime ?? "");
bool isMetadataSupportedMime(String mime) => bool isMetadataSupportedMime(String mime) =>
_metadataSupportedFormatMimes.contains(mime); metadataSupportedFormatMimes.contains(mime);
bool isMetadataSupportedFormat(FileDescriptor file) => bool isMetadataSupportedFormat(FileDescriptor file) =>
isMetadataSupportedMime(file.fdMime ?? ""); isMetadataSupportedMime(file.fdMime ?? "");
@ -138,7 +138,7 @@ final supportedImageFormatMimes =
final supportedVideoFormatMimes = final supportedVideoFormatMimes =
supportedFormatMimes.where((f) => f.startsWith("video/")).toList(); supportedFormatMimes.where((f) => f.startsWith("video/")).toList();
const _metadataSupportedFormatMimes = [ const metadataSupportedFormatMimes = [
"image/jpeg", "image/jpeg",
"image/heic", "image/heic",
]; ];