Skip to content

fix(base-scanner): derive media availability from actual season state…#2412

Merged
fallenbagel merged 1 commit intodevelopfrom
fallenbagel/fix/media-availability-status-calculation
Feb 13, 2026
Merged

fix(base-scanner): derive media availability from actual season state…#2412
fallenbagel merged 1 commit intodevelopfrom
fallenbagel/fix/media-availability-status-calculation

Conversation

@fallenbagel
Copy link
Copy Markdown
Collaborator

@fallenbagel fallenbagel commented Feb 13, 2026

Description

Fixes media being marked as AVAILABLE when only some seasons are actually
available (should be PARTIALLY_AVAILABLE). Previously, the scanner determined media-level availability by checking its own input array rather than the full set of tracked seasons. For example, a show with 33 seasons but only 1 available in Jellyfin would be marked AVAILABLE because the scanner only saw that 1 season and it was complete. A secondary shouldStayAvailable guard then locked this incorrect status
permanently.

This PR added availability checks against actual merged season objects and applied same fix to new media creation path.

Available to be tested at: preview-media-availability-status-fix tag. You'll need to run a full jellyfin scan/sonarr scan to fix the statuses.

How Has This Been Tested?

  • Run this fix
  • Run full jellyfin and sonarr scan
  • Observe statuses being corrected and able to request the affected ones again

Screenshots / Logs (if applicable)

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

… instead of scanner input

The media-level status was incorrectly set to AVAILABLE when only some seasons were available. The
issue was isAllStandardSeasons/isAll4kSeasons checked the scanner's input array which only contains
seasons found by current scanner (e.g. 1 seaason in jellyfin). If that single season was fully
available, the check passes and the media gets marked AVAILABLE regardless of how many total seasons
existed. And the shouldStayAvailable (and its 4k check) locked the AVAILABLE status once set, as
long as no new seasons were added with a status which prevented the incorrect status from correcting
itself.
@fallenbagel fallenbagel requested a review from a team as a code owner February 13, 2026 16:52
@fallenbagel
Copy link
Copy Markdown
Collaborator Author

Confirmed working by the original bug reporter:
https://discord.com/channels/952656177924300932/1471904318440607920/1471922066470207823

Screenshot_20260214_014557_Discord.jpg

Copy link
Copy Markdown
Member

@gauthier-th gauthier-th left a comment

Choose a reason for hiding this comment

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

LGTM. Tested and confirmed working.

@fallenbagel fallenbagel requested a review from Copilot February 13, 2026 17:57
@fallenbagel
Copy link
Copy Markdown
Collaborator Author

Let me do one quick final pass with copilot and then merge

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a critical bug where TV show media was incorrectly marked as AVAILABLE when only some seasons were actually available. The root cause was that the scanner determined media-level availability by checking only the input array of seasons (which might be a subset) rather than the full set of tracked seasons in the database. Additionally, a shouldStayAvailable guard was locking in this incorrect status permanently.

Changes:

  • Removed flawed availability logic that checked scanner input array instead of actual season state
  • Replaced with logic that checks the merged season objects (media.seasons) to determine overall availability
  • Removed shouldStayAvailable and shouldStayAvailable4k guards that prevented status correction
  • Applied the same fix to both existing media update path and new media creation path

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fallenbagel fallenbagel merged commit 15be3d7 into develop Feb 13, 2026
19 checks passed
@fallenbagel fallenbagel deleted the fallenbagel/fix/media-availability-status-calculation branch February 13, 2026 18:06
fallenbagel added a commit that referenced this pull request Feb 20, 2026
The Jellyfin scanner only passed seasons found in the library to processShow, so a show with only
one season downloaded would have all its Season entities marked available, causing the overall show
status to be AVAILABLE. Despite PR #2412 fixing the availability check to use actual Season entities
instead of scanner input, the underlying issue remained because Season entities were never created
for seasons missing from Jellyfin. This aligns the Jellyfin scanner with how the Plex scanner
already handles unmatched seasons.
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.

5 participants