Skip to content

Commit 0845073

Browse files
committed
Album flag workin in artist mode
1 parent 64ba09c commit 0845073

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

python2.7/music-organizer.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,13 @@ def artist(artistDir):
149149
elif ext == ".ogg":
150150
audio = OggVorbis(fullPath)
151151
title = audio['title'][0].encode('ascii', 'ignore')
152+
if args.album:
153+
album = audio['album'][0].encode('ascii', 'ignore')
152154
print(" title: " + title)
153155
except:
154156
title = None
157+
if args.album:
158+
album = None
155159

156160
if not title:
157161
print("Error: title not found for '" + filename + "'")
@@ -160,7 +164,13 @@ def artist(artistDir):
160164
neatTitle = toNeat(title)
161165
print(" neatTitle: " + neatTitle)
162166

163-
newFullPath = os.path.join(artistDir, neatTitle + ext)
167+
if args.album:
168+
neatAlbum = toNeat(album)
169+
print(" neatAlbum: " + neatAlbum)
170+
newFullPath = os.path.join(artistDir, neatAlbum, neatTitle + ext)
171+
172+
else:
173+
newFullPath = os.path.join(artistDir, neatTitle + ext)
164174
print(" newFullPath: " + newFullPath)
165175

166176
if newFullPath != fullPath:

0 commit comments

Comments
 (0)