mirror of
https://github.com/glomatico/votify.git
synced 2026-10-20 23:02:37 +02:00
Handle missing releaseDate in interfaces
This commit is contained in:
@@ -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],
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user