fix: wire tags filter through LibrarySearchFilter to SQLite adapter

This commit is contained in:
2026-07-12 15:29:06 +02:00
parent f52e024e98
commit 2995aea606
3 changed files with 23 additions and 1 deletions

View File

@@ -273,6 +273,19 @@ impl LibraryQuery for SqliteLibraryRepository {
.collect();
conditions.push(format!("({})", genre_conditions.join(" OR ")));
}
if !filter.tags().is_empty() {
let tag_conditions: Vec<String> = filter
.tags()
.iter()
.map(|t| {
format!(
"EXISTS (SELECT 1 FROM json_each(library_items.tags) WHERE LOWER(value) = LOWER('{}'))",
t.replace('\'', "''")
)
})
.collect();
conditions.push(format!("({})", tag_conditions.join(" OR ")));
}
if let Some(sn) = filter.season_number() {
conditions.push(format!("season_number = {}", sn));
}