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)
|
copyfile(path, dst)
|
||||||
else:
|
else:
|
||||||
print('File {0} not found.')
|
print('File {0} not found.')
|
||||||
|
return None
|
||||||
return dst
|
return dst
|
||||||
|
|
||||||
def tag_file(track: Track, file_name: str):
|
def tag_file(track: Track, file_name: str):
|
||||||
@@ -95,7 +96,8 @@ def main():
|
|||||||
|
|
||||||
for t in tracks:
|
for t in tracks:
|
||||||
new_file = copy_file(t, args.target)
|
new_file = copy_file(t, args.target)
|
||||||
tag_file(t, new_file)
|
if new_file is not None:
|
||||||
|
tag_file(t, new_file)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user