mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
fix: handle partial seasons more reliably (#4116)
refactor: remove matchingOldSeason variable
This commit is contained in:
@@ -58,19 +58,16 @@ export class MediaRequestSubscriber
|
||||
// Find all seasons in the related media entity
|
||||
// and see if they are available, then we can check
|
||||
// if the request contains the same seasons
|
||||
const requestedSeasons =
|
||||
entity.seasons?.map((entitySeason) => entitySeason.seasonNumber) ?? [];
|
||||
const availableSeasons = entity.media.seasons.filter(
|
||||
(season) =>
|
||||
season[entity.is4k ? 'status4k' : 'status'] === MediaStatus.AVAILABLE
|
||||
season[entity.is4k ? 'status4k' : 'status'] === MediaStatus.AVAILABLE &&
|
||||
requestedSeasons.includes(season.seasonNumber)
|
||||
);
|
||||
|
||||
const isMediaAvailable =
|
||||
availableSeasons.length > 0 &&
|
||||
availableSeasons.every((availableSeason) =>
|
||||
entity.seasons?.some(
|
||||
(entitySeason) =>
|
||||
entitySeason.seasonNumber === availableSeason.seasonNumber
|
||||
)
|
||||
);
|
||||
availableSeasons.length === requestedSeasons.length;
|
||||
|
||||
if (
|
||||
entity.media[entity.is4k ? 'status4k' : 'status'] ===
|
||||
|
Reference in New Issue
Block a user