diff options
author | Jackson Taylor <jackson@jacksontaylor.xyz> | 2021-11-15 15:01:00 -0500 |
---|---|---|
committer | Jackson Taylor <jackson@jacksontaylor.xyz> | 2022-04-05 16:52:06 -0400 |
commit | a93bf72318c96c4fee369744f06283211e898c17 (patch) | |
tree | 14e703e5e354190815d27889321505e44d9d369e /jamos | |
parent | 520141a872fe64cd2eb894033142826a96b0beb0 (diff) |
Prevent empty dates from not tagging years
Diffstat (limited to 'jamos')
-rwxr-xr-x | jamos | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -61,9 +61,15 @@ def write_metadata_to_song_file(file, metadata): def format_youtube_date(date): - fmt = "%Y%m%d" - d = datetime.datetime.strptime(date, fmt) - return d.year + default = "Unknown Year" + try: + fmt = "%Y%m%d" + d = datetime.datetime.strptime(date, fmt) + return d.year + except Exception as ex: + print(ex) + + return default def sort_stuff(): |