Merge branch 'SilvioDylan-master'

Adds indictor for unwatched episodes if the anime is currently airing
This commit is contained in:
Benex254
2024-08-06 08:45:28 +03:00
2 changed files with 7 additions and 0 deletions

View File

@@ -18,7 +18,9 @@ Welcome to **FastAnime**, anime site experience from the terminal.
<details>
<summary><b>Default mode</b></summary>
[fa_default_mode.webm](https://github.com/user-attachments/assets/1ce3a23d-f4a0-4bc1-8518-426ec7b3b69e)
</details>

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"]