-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sanitize playlist name while saving (#114)
fixes #101
- Loading branch information
1 parent
6a63fe3
commit c6ed775
Showing
3 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
def sanitize(name): | ||
""" | ||
Removes some of the reserved characters from the name so it can be saved | ||
:param name: Name to be cleaned up | ||
:return string containing the cleaned name | ||
""" | ||
clean_up_list = ["\\", "/", ":", "*", "?", "\"", "<", ">", "|", "\0"] | ||
return "".join(c for c in name if c not in clean_up_list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters