Skip to content

Commit

Permalink
Search should only try filename when there are no tags
Browse files Browse the repository at this point in the history
Fixes cmus#1262.
  • Loading branch information
gavtroy authored and flyingmutant committed Jul 12, 2023
1 parent aa6286b commit 83dadb8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions track_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ int track_info_matches_full(const struct track_info *ti, const char *text,
const char *word = words[i];

matched = 0;
if (flags_set(ti, flags) && match_word(ti, word, flags)) {
matched = 1;
if (flags_set(ti, flags)) {
matched = match_word(ti, word, flags);
} else {
/* compare with url or filename without path */
const char *filename = ti->filename;
Expand All @@ -201,7 +201,7 @@ int track_info_matches_full(const struct track_info *ti, const char *text,
matched = 1;
}

if (flags_set(ti, exclude_flags) && match_word(ti, word, exclude_flags))
if (match_word(ti, word, exclude_flags))
matched = 0;

if (match_all_words ? !matched : matched)
Expand Down

0 comments on commit 83dadb8

Please sign in to comment.