Catch potential file-not-found error
This commit is contained in:
@@ -44,6 +44,7 @@ def copy_file(track: Track, targetFolder) -> str:
|
||||
copyfile(path, dst)
|
||||
else:
|
||||
print('File {0} not found.')
|
||||
return None
|
||||
return dst
|
||||
|
||||
def tag_file(track: Track, file_name: str):
|
||||
@@ -95,6 +96,7 @@ def main():
|
||||
|
||||
for t in tracks:
|
||||
new_file = copy_file(t, args.target)
|
||||
if new_file is not None:
|
||||
tag_file(t, new_file)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user