new episode indicators for airing shows

This commit is contained in:
SilvioDylan
2024-08-05 23:40:40 +02:00
parent 99fa8f4d2c
commit 03e13006d4

View File

@@ -745,6 +745,11 @@ def select_anime(config: Config, anilist_config: QueryDict):
anime["title"][config.preferred_language] or anime["title"]["romaji"]
)
title = sanitize_filename(f"{title} ({progress} of {episodes_total})")
# Check if the anime is currently airing and has new/unwatched episodes
if anime["status"] == "RELEASING" and anime["nextAiringEpisode"] and progress > 0:
last_aired_episode = anime["nextAiringEpisode"]["episode"] - 1
if last_aired_episode - progress > 0:
title += f" 🔹{last_aired_episode - progress} new episode(s)🔹"
anime_data[title] = anime
choices = [*anime_data.keys(), "Back"]