mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-24 07:54:42 +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) =>
|
bool isSupportedFormat(File file) =>
|
||||||
_supportedFormatMimes.contains(file.contentType);
|
_supportedFormatMimes.contains(file.contentType);
|
||||||
|
|
||||||
|
bool isSupportedImageFormat(File file) =>
|
||||||
|
isSupportedFormat(file) && file.contentType?.startsWith("image/") == true;
|
||||||
|
|
||||||
const _supportedFormatMimes = [
|
const _supportedFormatMimes = [
|
||||||
"image/jpeg",
|
"image/jpeg",
|
||||||
"image/png",
|
"image/png",
|
||||||
|
|
|
@ -19,7 +19,7 @@ class ScanMissingMetadata {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
final missingMetadata = (d as List<File>).where((element) =>
|
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) {
|
for (final f in missingMetadata) {
|
||||||
yield f;
|
yield f;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue