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

Add filename character swap out option to preferences #49

Closed
scottmc opened this issue Nov 10, 2021 · 4 comments · Fixed by scottmc/Hare#2
Closed

Add filename character swap out option to preferences #49

scottmc opened this issue Nov 10, 2021 · 4 comments · Fixed by scottmc/Hare#2

Comments

@scottmc
Copy link
Member

scottmc commented Nov 10, 2021

Same issue as Calendar had, an attempt to put a / in the filename will result in chaos. Substitute the division slash whenever a / is in the song title.
See HaikuArchives/Calendar#96

@scottmc
Copy link
Member Author

scottmc commented Nov 10, 2021

Ran into a CD with this issue. Panic! at The Disco's Too Weird to Live, Too Rare to Die! track 6 song name is "Girls / Girls / Boys", after encoding, I found the resulting mp3 2 sub-directories down.

scottmc added a commit to scottmc/Hare that referenced this issue Nov 17, 2021
@scottmc
Copy link
Member Author

scottmc commented Nov 17, 2021

Note track 6, the Audio CD lookup by Haiku replaces the slashes with a dash as seen in the File column. This solution replaces the slash with the divisional slash as seen in the Save As column. This could later be added as a preferences option, giving the user the ability to pick what char to replace the slash with. But for now just put in the division slash.

Slash-Subbed

@humdingerb
Copy link
Member

It may be worth sticking with normal ASCII characters for replacement. Someone may have to type out a filename for some reason or use some antique file system that doesn't support those exotic characters.

@scottmc
Copy link
Member Author

scottmc commented Nov 18, 2021

I guess the target output for this program isn't always going to be for BeFS, but songs could end up on other systems, such as phones, tablets, rokus, cars, etc. So probably need to cover more cases than just slash. Likely have to swap out any chars that can trip up these others. Things like ? and * might fail on windows for instance. I'll hold off on this one and see if I can make a fuller list of chars that can trip things up. Found another good test CD, R.E.M. gives a test for .,?' What to replace these with? I'm leaning towards having this be a configurable option in the preferences. Some users might prefer underscores, others dashes, while other might like to have alternate unicode characters that look like what they are replacing.

questionmark-period-comma-test2

@scottmc scottmc changed the title Convert / in song titles to a division slash Add filename character swap out option to preferences Nov 18, 2021
scottmc added a commit that referenced this issue Oct 17, 2022
* Substitute Slash in output filename, fixes #49

* re-fix order of includes

* Add option to swap invalid filename chars out
Option to change them all to a - or _ or a close UTF8 replacement char.

* ReplaceInvalidFileCharsInBString to ReplaceInvalidFileChars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants