Skip to content

Commit

Permalink
Fixed a bug that prevented moving the song to the destination folder …
Browse files Browse the repository at this point in the history
…after successfully writing the metadata
  • Loading branch information
FaintWhisper committed Sep 1, 2021
1 parent c5e49ac commit 20974f6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ def correct_tags(filename, tags):

if "Alternative" in tags["genre"]:
tags["genre"] = tags["genre"].replace("Alternative", "Indie")

if "Alternativo" in tags["genre"]:
tags["genre"] = tags["genre"].replace("Alternativo", "Indie")

if " - Single" in tags["album_title"]:
tags["album_title"].replace(" - Single", "")
Expand Down Expand Up @@ -461,7 +464,10 @@ def write_tags(filename, tags):
if os.path.exists(dest):
os.remove(dest)

shutil.move(filename, OUTPUT[0])
if os.path.exists(filename):
shutil.move(filename, OUTPUT[0])
elif os.path.exists(title):
shutil.move(title, OUTPUT[0])

if writeTags == "n" and not "-A" in OPTIONS:
showMoreOptions = input("Show more options? (y/n): ")
Expand Down

0 comments on commit 20974f6

Please sign in to comment.