fix: wire tags filter through LibrarySearchFilter to SQLite adapter
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user