martpie / museeks

🎵 A simple, clean and cross-platform music player
https://museeks.io
MIT License
1.65k stars 196 forks source link

Adding a folder containing special char to the library does not work #377

Open vprigent opened 6 years ago

vprigent commented 6 years ago

When trying to add a specific new album (understand folder here ) to my library I noticed that nothing happened.

This is due to the name of the folder I jumped into Museeks to contain special regex chars. https://github.com/KeitIG/museeks/blob/master/src/ui/actions/LibraryActions.js#L115-L116

You can try, add some brackets, hooks or some special characters to a folder, try to import it and your folder won't import.

vprigent commented 6 years ago

A simple solution would be to add some escaping like this const pattern = path.join(RegExp.escape_path(folder, '**/*.*');

Beware that many of the solutions for escaping regex implies escaping the / as well and that it prevents globby from doing anything as the path won't be valid anymore.

martpie commented 6 years ago

You can try, add some brackets, hooks or some special characters to a folder, try to import it and your folder won't import.

I did not even know those were valid characters for folders. Will definitely need to have a look into it.

martpie commented 6 years ago

So I've just tried to import a folder called ~/Documents/temp/Asa}/ and everything went well. Can you specify your OS?

vprigent commented 6 years ago

Woops, I was talking about the square brackets ( [] )

I just tried with the curly ones and it works well

a2nt commented 6 years ago

@KeitIG try "â ãåðìàíèè" file names sometimes it happens when u have used file categorizing by tags software with wrong tags encoding.

martpie commented 6 years ago

I just tried again with a ] or files with special accents, and it works (on macOS), I'll try on Ubuntu.

martpie commented 6 years ago

@vprigent Can you reproduce this bug with 0.10?

vprigent commented 6 years ago

I just tried using the first music folder I could find with special chars, [Indie Rock] The Kooks - Listen [Deluxe Edition] 2014 (Jamal The Moroccan) Does hang on import. I have imported the Music folder containing folders with specific chars as the one above, files from these folders are correctly being imported.

I'll try again on Linux tonight, these are for Museeks 0.10 on macOS Sierra

EDIT > Same issue on Ubuntu 18.04

martpie commented 5 years ago

Reproducible, blocker for 0.11.

On it right now.

martpie commented 5 years ago

I fixed the infinite loading, but I cannot fix the search not happening in those folders yet.