Skip to content

Commit

Permalink
fix: seasonal anime not starting from first episode (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdaqo committed Jul 21, 2024
1 parent 6c097a5 commit 87d4675
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cli/src/anipy_cli/menus/seasonal_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ def _choose_latest(self) -> List[Tuple["Anime", LanguageTypeEnum, List["Episode"
anime = Anime.from_local_list_entry(s)
lang = s.language
episodes = anime.get_episodes(lang)
to_watch = episodes[episodes.index(s.episode) + 1 :]

if s.episode == -1:
to_watch = episodes
else:
to_watch = episodes[episodes.index(s.episode) + 1 :]

if len(to_watch) > 0:
ch = Choice(
value=(anime, lang, to_watch),
Expand Down Expand Up @@ -96,7 +101,7 @@ def add_anime(self):
)

if episode is None:
episode = anime.get_episodes(lang)[0]
episode = -1

self.seasonal_list.update(anime, episode=episode, language=lang)

Expand Down

0 comments on commit 87d4675

Please sign in to comment.