Commit 6859c22b authored by Max Kellermann's avatar Max Kellermann

SongFilter: "any" does not match file name

According to the protocol documentation, matching the file name was wrong. This removes some awkward special-case code.
parent 2d5413fc
...@@ -5,6 +5,7 @@ ver 0.18 (2012/??/??) ...@@ -5,6 +5,7 @@ ver 0.18 (2012/??/??)
* protocol: * protocol:
- new command "readcomments" lists arbitrary file tags - new command "readcomments" lists arbitrary file tags
- new command "toggleoutput" - new command "toggleoutput"
- "find"/"search" with "any" does not match file name
- new commands "findin", "searchin" with base URI - new commands "findin", "searchin" with base URI
- search for album artist falls back to the artist tag - search for album artist falls back to the artist tag
- re-add the "volume" command - re-add the "volume" command
......
...@@ -134,12 +134,9 @@ SongFilter::Item::Match(const Tag &_tag) const ...@@ -134,12 +134,9 @@ SongFilter::Item::Match(const Tag &_tag) const
bool bool
SongFilter::Item::Match(const Song &song) const SongFilter::Item::Match(const Song &song) const
{ {
if (tag == LOCATE_TAG_FILE_TYPE || tag == LOCATE_TAG_ANY_TYPE) { if (tag == LOCATE_TAG_FILE_TYPE) {
const auto uri = song.GetURI(); const auto uri = song.GetURI();
const bool result = StringMatch(uri.c_str()); return StringMatch(uri.c_str());
if (result || tag == LOCATE_TAG_FILE_TYPE)
return result;
} }
return song.tag != NULL && Match(*song.tag); return song.tag != NULL && Match(*song.tag);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment