global search: do not return trashed items
This commit is contained in:
parent
fc1234ca63
commit
529bd6b0e4
3 changed files with 5 additions and 5 deletions
|
@ -30,7 +30,7 @@ abstract class MetadataDb {
|
||||||
|
|
||||||
Future<void> updateEntry(int id, AvesEntry entry);
|
Future<void> updateEntry(int id, AvesEntry entry);
|
||||||
|
|
||||||
Future<Set<AvesEntry>> searchEntries(String query, {int? limit});
|
Future<Set<AvesEntry>> searchLiveEntries(String query, {int? limit});
|
||||||
|
|
||||||
// date taken
|
// date taken
|
||||||
|
|
||||||
|
|
|
@ -215,11 +215,11 @@ class SqfliteMetadataDb implements MetadataDb {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Set<AvesEntry>> searchEntries(String query, {int? limit}) async {
|
Future<Set<AvesEntry>> searchLiveEntries(String query, {int? limit}) async {
|
||||||
final rows = await _db.query(
|
final rows = await _db.query(
|
||||||
entryTable,
|
entryTable,
|
||||||
where: 'title LIKE ?',
|
where: 'title LIKE ? AND trashed = ?',
|
||||||
whereArgs: ['%$query%'],
|
whereArgs: ['%$query%', 0],
|
||||||
orderBy: 'sourceDateTakenMillis DESC',
|
orderBy: 'sourceDateTakenMillis DESC',
|
||||||
limit: limit,
|
limit: limit,
|
||||||
);
|
);
|
||||||
|
|
|
@ -51,7 +51,7 @@ Future<List<Map<String, String?>>> _getSuggestions(dynamic args) async {
|
||||||
debugPrint('getSuggestions query=$query, locale=$locale use24hour=$use24hour');
|
debugPrint('getSuggestions query=$query, locale=$locale use24hour=$use24hour');
|
||||||
|
|
||||||
if (query is String && locale is String) {
|
if (query is String && locale is String) {
|
||||||
final entries = await metadataDb.searchEntries(query, limit: 9);
|
final entries = await metadataDb.searchLiveEntries(query, limit: 9);
|
||||||
suggestions.addAll(entries.map((entry) {
|
suggestions.addAll(entries.map((entry) {
|
||||||
final date = entry.bestDate;
|
final date = entry.bestDate;
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue