Added code to remove brackets in file name #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If you are watching movies or other stuff with info in file names such as [1080p], [Translation Group Name] and you want to get rid of it, with this update you can use new config line "exports.ignoreBrackets = true" and all brackets and their content will disappear.
It only removes [ ] and everything between them. It will keep ( ) and other brackets.
I just wanted to add a way to switch it ON and OFF since some people might want to keep the brackets so I added new config line called ignoreBrackets that is boolean type. I added ./config as required in core.js and it's reading the ignoreBracket setting in the same way and in the same place as index.js is reading the port.
I wasn't sure how to do the replace part, so you might keep it as it is or change it to
if (ignoreBrackets) playback.filename = document.getElementById('filepath').textContent.split("\").pop().replace(/ [[^)]] */g, "").trimStr(128);
else playback.filename = document.getElementById('filepath').textContent.split("\").pop().trimStr(128);
edit: fixed regex, was pretty tired last night and didn't have a chance to test it fully...