mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
Only scan metadata for images
This commit is contained in:
parent
9aabe2cb10
commit
391226f56b
2 changed files with 4 additions and 1 deletions
|
@ -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",
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue