Skip to content

Conversation

@kw6423
Copy link
Contributor

@kw6423 kw6423 commented Jun 19, 2025

🐛 Bugfix: Incorrect file filtering in getFiles method for Sonarr when seasonNumber == id

Problem

The getFiles method in the Arr class behaved incorrectly for Sonarr when the seasonNumber matched the series id. In such cases, it returned all episode files for the entire series, instead of just the files for the requested season.

This issue was isolated to the getFiles method — no other logic or behavior in Sonarr or Radarr was affected.

Changes

  • Moved filtering logic into the Sonarr class to properly handle Sonarr-specific behavior.
  • ✅ Left Radarr behavior untouched, as it does not require filtering.
  • Standardized the getFiles(media: Media, childId: int = None) method signature in the base Arr class to ensure consistent usage and avoid TypeError.

Impact

This change ensures the getFiles method returns only the correct season’s files for Sonarr, even when seasonNumber == id.

Previously, this bug would cause repair to check and process all seasons except the one with id twice — once directly by seasonNumber, and again when the full-series files were returned due to the ID match.

Other methods and features are unaffected — this fix is strictly scoped to getFiles.

@kw6423 kw6423 changed the title ## 🐛 Bugfix: Incorrect file filtering for Sonarr when seasonNumber == seriesId 🐛 Bugfix: Incorrect file filtering for Sonarr when seasonNumber == seriesId Jun 19, 2025
Copy link
Owner

@westsurname westsurname left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@westsurname westsurname merged commit 226c6b9 into westsurname:main Jun 20, 2025
0 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants