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.
This commit is contained in:
Max Kellermann
2013-10-29 19:54:40 +01:00
parent 2d5413fc3b
commit 6859c22b69
2 changed files with 3 additions and 5 deletions

View File

@@ -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);