fix: tracklist generation without timestamps
Some checks failed
ci/woodpecker/push/build Pipeline failed
Some checks failed
ci/woodpecker/push/build Pipeline failed
This commit is contained in:
parent
776cf139fa
commit
17cbc327d3
1 changed files with 11 additions and 2 deletions
|
@ -59,7 +59,11 @@ def update_episode_tracklist(
|
||||||
|
|
||||||
description += f"\n\n{TRACK_LIST_HEADING}\n\n"
|
description += f"\n\n{TRACK_LIST_HEADING}\n\n"
|
||||||
|
|
||||||
sorted_tracks = sorted(track_list, key=lambda x: x["timestamp"].total_seconds())
|
try:
|
||||||
|
sorted_tracks = sorted(track_list, key=lambda x: x["timestamp"].total_seconds())
|
||||||
|
except:
|
||||||
|
sorted_tracks = track_list
|
||||||
|
|
||||||
id_count = 1
|
id_count = 1
|
||||||
|
|
||||||
for i, track in enumerate(sorted_tracks):
|
for i, track in enumerate(sorted_tracks):
|
||||||
|
@ -78,7 +82,12 @@ def update_episode_tracklist(
|
||||||
# clean up the title
|
# clean up the title
|
||||||
title_str = clean_track_title(title_str)
|
title_str = clean_track_title(title_str)
|
||||||
|
|
||||||
description += f"{i + 1}. {title_str} _- {artist_str} [{str(track.get('timestamp', timedelta(seconds=0)))}]_\n"
|
description += f"{i + 1}. {title_str} _- {artist_str}"
|
||||||
|
|
||||||
|
if "timestamp" in track:
|
||||||
|
description += f" [{str(track.get('timestamp', timedelta(seconds=0)))}]"
|
||||||
|
|
||||||
|
description += "_\n"
|
||||||
|
|
||||||
episode.description = description.strip()
|
episode.description = description.strip()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue