Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
c26703b7
Commit
c26703b7
authored
Oct 22, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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`.
parent
db27bb76
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
NEWS
NEWS
+1
-0
SongFilter.cxx
src/SongFilter.cxx
+9
-9
No files found.
NEWS
View file @
c26703b7
ver 0.20.22 (not yet released)
* protocol
- add tag fallbacks for AlbumArtistSort, ArtistSort
- fix empty string filter on fallback tags
- "count group ..." can print an empty group
- fix broken command "list ... group"
* storage
...
...
src/SongFilter.cxx
View file @
c26703b7
...
...
@@ -110,15 +110,6 @@ SongFilter::Item::Match(const Tag &_tag) const noexcept
}
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
;
if
(
ApplyTagFallback
(
TagType
(
tag
),
[
&
](
TagType
tag2
)
{
...
...
@@ -136,6 +127,15 @@ SongFilter::Item::Match(const Tag &_tag) const noexcept
return
true
;
}))
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment