fix: also remove available/partially available seasons from requests

feature/watchlist-sync
Ryan Cohen 2 years ago
parent eada54e7be
commit c4e47ae763

@ -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)
);

Loading…
Cancel
Save