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

Filter / characters out of filenames #6

Merged
merged 2 commits into from
Feb 27, 2019
Merged

Conversation

nokyan
Copy link
Contributor

@nokyan nokyan commented Feb 27, 2019

Recording tracks that have a "/" in their title previously didn't work, this hacky solution fixes it by just replacing every "/" in the filename with nothing.

Recording tracks that have a "/" in their title previously didn't work, this hacky solution fixes it by just replacing every "/" in the filename with nothing.
@Bleuzen
Copy link
Owner

Bleuzen commented Feb 27, 2019

Thanks, but there is room to improve:

  • Use an underscore instead of an empty string. "_" is much more common as replacement, nothing may look weird, for example if the char before and after is a space.

  • Try to avoid having multiple copies of the same code. This could be a one-liner. What about reverting your changes in the two lines and just use this below:

self.filename = self.filename.replace("/", "_")

@Bleuzen
Copy link
Owner

Bleuzen commented Feb 27, 2019

Ok great :)

@Bleuzen Bleuzen merged commit 6281bd2 into Bleuzen:master Feb 27, 2019
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.

2 participants