Skip to content

Search should only try filename when there are no tags - #1263

Merged
flyingmutant merged 1 commit into
cmus:masterfrom
gavtroy:dont_search_in_filename
Jul 12, 2023
Merged

flyingmutant merged 1 commit into
cmus:masterfrom
gavtroy:dont_search_in_filename

Conversation

@gavtroy

@gavtroy gavtroy commented Jul 2, 2023

Copy link
Copy Markdown
Collaborator

Although this might be up for debate, but to me it seems like this was probably always the intended behavior.

Fixes #1262.

@flyingmutant
flyingmutant force-pushed the dont_search_in_filename branch from 6448a53 to 2c9bc8e Compare July 8, 2023 18:53

@pgaskin pgaskin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flyingmutant
flyingmutant force-pushed the dont_search_in_filename branch from 2c9bc8e to fc2938a Compare July 9, 2023 06:16
Comment thread track_info.c
}

if (flags_set(ti, exclude_flags) && match_word(ti, word, exclude_flags))
if (match_word(ti, word, exclude_flags))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we call flags_set here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just not needed because match_word() does the same checks anyway. This line isn't fixing anything, I just thought it was clearer to understand.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the same goes for call to flags_set above: they should either both be present, or both be absent for consistency. Probably flags_set was used as an optimization, to avoid any string comparisons, but I am not sure.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first one is needed though, to distinguish "no applicable tags -- fallback to filename search" from "no match -- don't fall back to filename".

@flyingmutant
flyingmutant merged commit 83dadb8 into cmus:master Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Artist/Album search with *//* includes title tags in view 1

3 participants