diff --git a/votify/interface/episode.py b/votify/interface/episode.py index e07ff5d..af623e8 100644 --- a/votify/interface/episode.py +++ b/votify/interface/episode.py @@ -76,10 +76,14 @@ class SpotifyEpisodeInterface(SpotifyAudioInterface): show_items: list[dict], is_video: bool = False, ) -> MediaTags: + release_date = episode_data["releaseDate"] + tags = MediaTags( album=episode_data["podcastV2"]["data"]["name"], - date=SpotifyAudioInterface.parse_date( - episode_data["releaseDate"]["isoString"] + date=( + SpotifyAudioInterface.parse_date(release_date["isoString"]) + if release_date + else None ), description=episode_data.get("description"), media_id=episode_data["uri"].split(":")[-1], diff --git a/votify/interface/song.py b/votify/interface/song.py index 26635ab..d2d0e91 100644 --- a/votify/interface/song.py +++ b/votify/interface/song.py @@ -105,7 +105,7 @@ class SpotifySongInterface(SpotifyAudioInterface): album_items: list[dict], lyrics: str | None = None, ) -> MediaTags: - iso_date = album_data["date"]["isoString"] + release_date = album_data["date"] (composer, producer), (album_artist, artist, isrc, label) = ( await asyncio.gather( @@ -130,7 +130,7 @@ class SpotifySongInterface(SpotifyAudioInterface): compilation=compilation, composer=composer, copyright=copyright, - date=self.parse_date(iso_date), + date=self.parse_date(release_date["isoString"]) if release_date else None, disc=disc, disc_total=disc_total, isrc=isrc,