fix: correct notification sending for wrong status (#4113)

This commit is contained in:
Brandon Cohen
2025-04-16 11:23:30 -05:00
committed by GitHub
parent 8b465dc210
commit 9275a097f7

View File

@@ -58,14 +58,17 @@ export class MediaRequestSubscriber
// Find all seasons in the related media entity // Find all seasons in the related media entity
// and see if they are available, then we can check // and see if they are available, then we can check
// if the request contains the same seasons // if the request contains the same seasons
const isMediaAvailable = entity.media.seasons const availableSeasons = entity.media.seasons.filter(
.filter( (season) =>
(season) => season[entity.is4k ? 'status4k' : 'status'] === MediaStatus.AVAILABLE
season[entity.is4k ? 'status4k' : 'status'] === MediaStatus.AVAILABLE );
)
.every((seasonRequest) => const isMediaAvailable =
entity.seasons.find( availableSeasons.length > 0 &&
(season) => season.seasonNumber === seasonRequest.seasonNumber availableSeasons.every((availableSeason) =>
entity.seasons?.some(
(entitySeason) =>
entitySeason.seasonNumber === availableSeason.seasonNumber
) )
); );