Only scan metadata for images

This commit is contained in:
Ming Ming 2021-05-06 14:29:46 +08:00
parent 9aabe2cb10
commit 391226f56b
2 changed files with 4 additions and 1 deletions

View file

@ -3,6 +3,9 @@ import 'package:nc_photos/entity/file.dart';
bool isSupportedFormat(File file) =>
_supportedFormatMimes.contains(file.contentType);
bool isSupportedImageFormat(File file) =>
isSupportedFormat(file) && file.contentType?.startsWith("image/") == true;
const _supportedFormatMimes = [
"image/jpeg",
"image/png",

View file

@ -19,7 +19,7 @@ class ScanMissingMetadata {
continue;
}
final missingMetadata = (d as List<File>).where((element) =>
file_util.isSupportedFormat(element) && element.metadata == null);
file_util.isSupportedImageFormat(element) && element.metadata == null);
for (final f in missingMetadata) {
yield f;
}