Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
Fix groupby dosen't work for multiple groupable blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Paillat-dev committed Jul 28, 2024
1 parent a740733 commit 126454c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/exts/tvdb_info/ui/profile_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ async def _initialize(self) -> None:
# We don't actually care about episodes in the profile view, however, we need them
# because of the way shows are marked as watched (last episode watched -> show watched).

for series_id, episodes in groupby(watched_episodes, key=lambda x: x.series_id):
for series_id, episodes in groupby(
sorted(watched_episodes, key=lambda x: x.series_id), key=lambda x: x.series_id
):
series = await Series.fetch(series_id, client=self.tvdb_client, extended=True, meta=FetchMeta.EPISODES)
if series.episodes is None:
raise ValueError("Found an episode in watched list for a series with no episodes")
Expand Down

0 comments on commit 126454c

Please sign in to comment.