Error handling

This commit is contained in:
Alok Saboo 2023-12-22 10:25:27 -05:00
parent 2eb8000a0b
commit 7440ca51fb

View file

@ -160,8 +160,11 @@ class ListenBrainzPlugin(BeetsPlugin):
playlist_type = (
"Exploration" if "Exploration" in title else "Jams"
)
date_str = title.split("week of ")[1].split(" ")[0]
date = datetime.datetime.strptime(date_str, "%Y-%m-%d").date()
if "week of " in title:
date_str = title.split("week of ")[1].split(" ")[0]
date = datetime.datetime.strptime(date_str, "%Y-%m-%d").date()
else:
date = None
identifier = playlist_info.get("identifier")
id = identifier.split("/")[-1]
listenbrainz_playlists.append(