Skip to content

Commit 6cca4cc

Browse files
committed
Allow '=' in song names. Ignore dotfiles.
1 parent 009f5e1 commit 6cca4cc

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

python2.7/music-organizer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ def toNeat(s):
6464
s = re.sub("^-*", "", s)
6565
s = re.sub("-*$", "", s)
6666

67-
# Ensure the string is only alphanumeric with '-' and '+'.
68-
search = re.search("[^0-9a-z\-\+]", s)
67+
# Ensure the string is only alphanumeric with '-', '+', and '='.
68+
search = re.search("[^0-9a-z\-\+\=]", s)
6969
if search:
7070
print("Error: Unrecognized character in '" + s + "'")
7171
sys.exit(-42)
@@ -151,6 +151,9 @@ def artist(artistDir):
151151
shutil.rmtree(os.path.join(artistDir,d),ignore_errors=True)
152152

153153
def song(filename):
154+
if filename[0] == '.':
155+
print("Ignoring dotfile: '{}'".format(filename))
156+
return
154157
print("Organizing song '" + filename + "'.")
155158
ext = os.path.splitext(filename)[1]
156159
try:

0 commit comments

Comments
 (0)