minor fix, search by id

This commit is contained in:
Thibault Deckers 2021-09-10 17:33:00 +09:00
parent e8a4480884
commit c03c72fa49
2 changed files with 9 additions and 1 deletions

View file

@ -33,7 +33,10 @@ object MetadataExtractorHelper {
}
fun Directory.getSafeDateMillis(tag: Int, save: (value: Long) -> Unit) {
if (this.containsTag(tag)) save(this.getDate(tag, null, TimeZone.getDefault()).time)
if (this.containsTag(tag)) {
val date = this.getDate(tag, null, TimeZone.getDefault())
if (date != null) save(date.time)
}
}
// geotiff

View file

@ -19,6 +19,11 @@ class QueryFilter extends CollectionFilter {
QueryFilter(this.query, {this.colorful = true}) {
var upQuery = query.toUpperCase();
if (upQuery.startsWith('ID=')) {
final id = int.tryParse(upQuery.substring(3));
_test = (entry) => entry.contentId == id;
return;
}
// allow NOT queries starting with `-`
final not = upQuery.startsWith('-');