fix: exclude downloaded episodes from episodeDict and GetMissingEpisode
Prevent fully-downloaded series from being queued by auto-download: - SerieList.GetMissingEpisode(): filter by is_downloaded instead of checking if episodeDict is non-empty. episodeDict from the DB relationship includes all episodes (including downloaded), so a series with only downloaded episodes still had a truthy episodeDict. - AnimeSeries.episodeDict property: skip episodes where is_downloaded=True when building the dict from the DB relationship. This makes the property consistent with the is_downloaded filtering already done manually in list_series_with_filters(), and ensures that calling code anywhere in the codebase gets the correct missing-episode view. Fixes hana-kimi (and any other fully-downloaded series) incorrectly appearing in the auto-download queue after a rescan.
This commit is contained in:
@@ -205,6 +205,8 @@ class AnimeSeries(Base, TimestampMixin):
|
||||
try:
|
||||
if self.episodes:
|
||||
for ep in self.episodes:
|
||||
if ep.is_downloaded:
|
||||
continue
|
||||
season = ep.season or 1
|
||||
if season not in episode_dict:
|
||||
episode_dict[season] = []
|
||||
|
||||
Reference in New Issue
Block a user