fix: filter specials from modal all seasons and watchlist (#4108)

* fix: filter specials from modal all seasons and watchlist

* fix: skip specials when marking available

* fix: edge case where specials were marked as completed
This commit is contained in:
Brandon Cohen
2025-04-19 19:30:58 -05:00
committed by GitHub
parent 208d31180c
commit 7f868f38e6
5 changed files with 59 additions and 53 deletions

View File

@@ -96,7 +96,9 @@ const ManageSlideOver = ({
if (data.mediaInfo) {
await axios.post(`/api/v1/media/${data.mediaInfo?.id}/available`, {
is4k,
...(mediaType === 'tv' && { seasons: data.seasons }),
...(mediaType === 'tv' && {
seasons: data.seasons.filter((season) => season.seasonNumber !== 0),
}),
});
revalidate();
}

View File

@@ -309,12 +309,16 @@ const TvRequestModal = ({
return;
}
const standardUnrequestedSeasons = unrequestedSeasons.filter(
(seasonNumber) => seasonNumber !== 0
);
if (
data &&
selectedSeasons.length >= 0 &&
selectedSeasons.length < unrequestedSeasons.length
selectedSeasons.length < standardUnrequestedSeasons.length
) {
setSelectedSeasons(unrequestedSeasons);
setSelectedSeasons(standardUnrequestedSeasons);
} else {
setSelectedSeasons([]);
}
@@ -325,9 +329,9 @@ const TvRequestModal = ({
return false;
}
return (
selectedSeasons.length ===
selectedSeasons.filter((season) => season !== 0).length ===
getAllSeasons().filter(
(season) => !getAllRequestedSeasons().includes(season)
(season) => !getAllRequestedSeasons().includes(season) && season !== 0
).length
);
};