Different approach for matching title filters

This commit is contained in:
Bill Thiede 2020-02-05 16:50:15 -08:00
parent e3f96f34c9
commit 7fb8a08118

View File

@ -111,15 +111,13 @@ fn list_albums(
.iter_shared_albums_with_all_fields()
{
let a = album?;
if let Some(title_filter) = &title_filter {
match &a.title {
Some(title) => {
if !title_filter.is_match(&title) {
continue;
}
}
None => continue,
}
match (&title_filter, &a.title) {
// Print everything when no filter or title.
(None, None) => {}
// skip when filter given but the media item doesn't have a title (it can't match)
(_, None) => continue,
// skip when the media item doesn't match the filter
(Some(title_filter), Some(title)) if !title_filter.is_match(&title) => continue,
}
println!(
"album: {} {} ({} items)",