feat: add a setting for special episodes (#1193)

* feat: add a setting for special episodes

This PR adds a separate setting for special episodes and disables them by default, to avoid unwanted
library status updates.

* refactor(settings): re-order setting for allow specials request

---------

Co-authored-by: fallenbagel <98979876+Fallenbagel@users.noreply.github.com>
This commit is contained in:
Gauthier
2024-12-29 22:03:49 +01:00
committed by GitHub
parent 66948b420f
commit b6e2e6ce61
15 changed files with 108 additions and 29 deletions

View File

@@ -253,9 +253,13 @@ const TvRequestModal = ({
};
const getAllSeasons = (): number[] => {
return (data?.seasons ?? [])
.filter((season) => season.episodeCount !== 0)
.map((season) => season.seasonNumber);
let allSeasons = (data?.seasons ?? []).filter(
(season) => season.episodeCount !== 0
);
if (!settings.currentSettings.partialRequestsEnabled) {
allSeasons = allSeasons.filter((season) => season.seasonNumber !== 0);
}
return allSeasons.map((season) => season.seasonNumber);
};
const getAllRequestedSeasons = (): number[] => {
@@ -577,7 +581,12 @@ const TvRequestModal = ({
</thead>
<tbody className="divide-y divide-gray-700">
{data?.seasons
.filter((season) => season.episodeCount !== 0)
.filter(
(season) =>
(!settings.currentSettings.enableSpecialEpisodes
? season.seasonNumber !== 0
: true) && season.episodeCount !== 0
)
.map((season) => {
const seasonRequest = getSeasonRequest(
season.seasonNumber