aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-29 19:54:40 +0100
committerMax Kellermann <max@duempel.org>2013-10-29 20:40:55 +0100
commit6859c22b692f153c6f860c0336dd686f94a11c08 (patch)
tree4c6c353c8aefbe98f8574b5bcfb90b3f911ab531
parent2d5413fc3ba2dc77189bed3dfbbc65ad4243e477 (diff)
downloadmpd-6859c22b692f153c6f860c0336dd686f94a11c08.tar.gz
mpd-6859c22b692f153c6f860c0336dd686f94a11c08.tar.xz
mpd-6859c22b692f153c6f860c0336dd686f94a11c08.zip
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.
Diffstat (limited to '')
-rw-r--r--NEWS1
-rw-r--r--src/SongFilter.cxx7
2 files changed, 3 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index e1d23428d..feb591050 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ ver 0.18 (2012/??/??)
* protocol:
- new command "readcomments" lists arbitrary file tags
- new command "toggleoutput"
+ - "find"/"search" with "any" does not match file name
- new commands "findin", "searchin" with base URI
- search for album artist falls back to the artist tag
- re-add the "volume" command
diff --git a/src/SongFilter.cxx b/src/SongFilter.cxx
index 41f1e0a64..7592f2665 100644
--- a/src/SongFilter.cxx
+++ b/src/SongFilter.cxx
@@ -134,12 +134,9 @@ SongFilter::Item::Match(const Tag &_tag) const
bool
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 bool result = StringMatch(uri.c_str());
-
- if (result || tag == LOCATE_TAG_FILE_TYPE)
- return result;
+ return StringMatch(uri.c_str());
}
return song.tag != NULL && Match(*song.tag);