Different approach for matching title filters
This commit is contained in:
parent
e3f96f34c9
commit
7fb8a08118
16
src/main.rs
16
src/main.rs
@ -111,15 +111,13 @@ fn list_albums(
|
|||||||
.iter_shared_albums_with_all_fields()
|
.iter_shared_albums_with_all_fields()
|
||||||
{
|
{
|
||||||
let a = album?;
|
let a = album?;
|
||||||
if let Some(title_filter) = &title_filter {
|
match (&title_filter, &a.title) {
|
||||||
match &a.title {
|
// Print everything when no filter or title.
|
||||||
Some(title) => {
|
(None, None) => {}
|
||||||
if !title_filter.is_match(&title) {
|
// skip when filter given but the media item doesn't have a title (it can't match)
|
||||||
continue;
|
(_, None) => continue,
|
||||||
}
|
// skip when the media item doesn't match the filter
|
||||||
}
|
(Some(title_filter), Some(title)) if !title_filter.is_match(&title) => continue,
|
||||||
None => continue,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
println!(
|
println!(
|
||||||
"album: {} {} ({} items)",
|
"album: {} {} ({} items)",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user