Skip to content

Commit

Permalink
fix: correct typos for the special episodes setting (Fallenbagel#1209)
Browse files Browse the repository at this point in the history
Some typos were introduced by Fallenbagel#1193, enableSpecialEpisodes and partialRequestsEnabled were mixed up.

fix Fallenbagel#1208
  • Loading branch information
gauthier-th authored Dec 31, 2024
1 parent 7e94ad7 commit ebe7d11
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions server/entity/MediaRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,14 @@ export class MediaRequest {
const tmdbMediaShow = tmdbMedia as Awaited<
ReturnType<typeof tmdb.getTvShow>
>;
const requestedSeasons =
let requestedSeasons =
requestBody.seasons === 'all'
? settings.main.enableSpecialEpisodes
? tmdbMediaShow.seasons.map((season) => season.season_number)
: tmdbMediaShow.seasons
.map((season) => season.season_number)
.filter((sn) => sn > 0)
? tmdbMediaShow.seasons.map((season) => season.season_number)
: (requestBody.seasons as number[]);
if (!settings.main.enableSpecialEpisodes) {
requestedSeasons = requestedSeasons.filter((sn) => sn > 0);
}

let existingSeasons: number[] = [];

// We need to check existing requests on this title to make sure we don't double up on seasons that were
Expand Down
2 changes: 1 addition & 1 deletion server/lib/scanners/sonarr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class SonarrScanner
const filteredSeasons = sonarrSeries.seasons.filter(
(sn) =>
tvShow.seasons.find((s) => s.season_number === sn.seasonNumber) &&
(!settings.main.partialRequestsEnabled ? sn.seasonNumber !== 0 : true)
(!settings.main.enableSpecialEpisodes ? sn.seasonNumber !== 0 : true)
);

for (const season of filteredSeasons) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/RequestModal/TvRequestModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ const TvRequestModal = ({
let allSeasons = (data?.seasons ?? []).filter(
(season) => season.episodeCount !== 0
);
if (!settings.currentSettings.partialRequestsEnabled) {
allSeasons = allSeasons.filter((season) => season.seasonNumber !== 0);
if (!settings.currentSettings.enableSpecialEpisodes) {
allSeasons = allSeasons.filter((season) => season.seasonNumber > 0);
}
return allSeasons.map((season) => season.seasonNumber);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/TvDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
const showHasSpecials = data.seasons.some(
(season) =>
season.seasonNumber === 0 &&
settings.currentSettings.partialRequestsEnabled
settings.currentSettings.enableSpecialEpisodes
);

const isComplete =
Expand Down

0 comments on commit ebe7d11

Please sign in to comment.