summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackson Taylor <jackson@jacksontaylor.xyz>2022-08-07 09:18:34 -0400
committerJackson Taylor <jackson@jacksontaylor.xyz>2022-08-07 09:18:34 -0400
commit399a62c169aa26dc2c7076d1497da82df36cfd9e (patch)
treebd910307d1125993f8e22c4653f392d45a3b81f1
parentf20d63482029c02890239f70eb7057f696192021 (diff)
Handle None year in metadata
If the release date was None then it would break and not try to move the file or anything
-rwxr-xr-xjamos3
1 files changed, 2 insertions, 1 deletions
diff --git a/jamos b/jamos
index bca6f0c..0783e70 100755
--- a/jamos
+++ b/jamos
@@ -171,7 +171,8 @@ def get_song_metadata_from_json(json, counter):
if ('title' in json.keys()) and (json['title'] is not None):
metadata['title'] = json['title']
- if ('release_date' in json.keys()):
+ if ('release_date' in json.keys() and
+ json['release_date'] is not None):
metadata['year'] = format_youtube_date(json['release_date'])
artist_for_filename = metadata['artist'].replace(' ', '_').lower()