forked from wathiede/photosync
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()
|
||||
{
|
||||
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)",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user