SongFilter: check value.empty() after checking tag fallbacks
In this new order, a filter 'AlbumArtist ""' matches only on songs which neither have `AlbumArtist` nor `Artist`.
This commit is contained in:
parent
db27bb76e2
commit
c26703b7e6
1
NEWS
1
NEWS
|
@ -1,6 +1,7 @@
|
||||||
ver 0.20.22 (not yet released)
|
ver 0.20.22 (not yet released)
|
||||||
* protocol
|
* protocol
|
||||||
- add tag fallbacks for AlbumArtistSort, ArtistSort
|
- add tag fallbacks for AlbumArtistSort, ArtistSort
|
||||||
|
- fix empty string filter on fallback tags
|
||||||
- "count group ..." can print an empty group
|
- "count group ..." can print an empty group
|
||||||
- fix broken command "list ... group"
|
- fix broken command "list ... group"
|
||||||
* storage
|
* storage
|
||||||
|
|
|
@ -110,15 +110,6 @@ SongFilter::Item::Match(const Tag &_tag) const noexcept
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag < TAG_NUM_OF_ITEM_TYPES && !visited_types[tag]) {
|
if (tag < TAG_NUM_OF_ITEM_TYPES && !visited_types[tag]) {
|
||||||
/* If the search critieron was not visited during the
|
|
||||||
sweep through the song's tag, it means this field
|
|
||||||
is absent from the tag or empty. Thus, if the
|
|
||||||
searched string is also empty
|
|
||||||
then it's a match as well and we should return
|
|
||||||
true. */
|
|
||||||
if (value.empty())
|
|
||||||
return true;
|
|
||||||
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
if (ApplyTagFallback(TagType(tag),
|
if (ApplyTagFallback(TagType(tag),
|
||||||
[&](TagType tag2) {
|
[&](TagType tag2) {
|
||||||
|
@ -136,6 +127,15 @@ SongFilter::Item::Match(const Tag &_tag) const noexcept
|
||||||
return true;
|
return true;
|
||||||
}))
|
}))
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
/* If the search critieron was not visited during the
|
||||||
|
sweep through the song's tag, it means this field
|
||||||
|
is absent from the tag or empty. Thus, if the
|
||||||
|
searched string is also empty
|
||||||
|
then it's a match as well and we should return
|
||||||
|
true. */
|
||||||
|
if (value.empty())
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue