Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape special regex characters in library path scan #532

Merged
merged 1 commit into from
May 5, 2020

Conversation

GilgameshxZero
Copy link
Contributor

Directory path patterns passed to globby may contain special regex characters which will not parse correctly, leading museeks to fail to scan some directories containing those characters. This PR escapes the regex characters in directory paths.

The current (buggy) behavior is visible by creating a directory named (test) (( and ) are special regex characters) and placing within it any .mp3 file. Attempting to add the (test) directory to the library will not add any .mp3 files within.

The relevant special characters are $^*+?()[]. More information is at fast-glob and micromatch.

Copy link
Contributor

@vprigent vprigent left a comment

Choose a reason for hiding this comment

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

This should solve #377.
Code looks good, I'll try to give it a try this afternoon!
EDIT> Gave it a try, it does solve #377!

Thanks a lot @GilgameshxZero !

Copy link
Owner

@martpie martpie left a comment

Choose a reason for hiding this comment

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

♥️

@martpie martpie merged commit ea2ace2 into martpie:master May 5, 2020
@GilgameshxZero GilgameshxZero deleted the bugfix-path-regex-char branch December 25, 2020 17:54
martpie added a commit that referenced this pull request May 25, 2022
Escape special regex characters in library path scan
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.

3 participants