diff --git a/server/entity/MediaRequest.ts b/server/entity/MediaRequest.ts index 91a5f7104..a02733964 100644 --- a/server/entity/MediaRequest.ts +++ b/server/entity/MediaRequest.ts @@ -242,6 +242,22 @@ export class MediaRequest { }, [] as number[]); } + // We should also check seasons that are available/partially available but don't have existing requests + if (media.seasons) { + existingSeasons = [ + ...existingSeasons, + ...media.seasons + .filter( + (season) => + season[requestBody.is4k ? 'status4k' : 'status'] === + MediaStatus.AVAILABLE || + season[requestBody.is4k ? 'status4k' : 'status'] === + MediaStatus.PARTIALLY_AVAILABLE + ) + .map((season) => season.seasonNumber), + ]; + } + const finalSeasons = requestedSeasons.filter( (rs) => !existingSeasons.includes(rs) );