mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
fix: correct specials affecting availability status (#4092)
* fix: remove specials affecting availability status * refactor: add comments for scanner
This commit is contained in:
@@ -324,19 +324,25 @@ class BaseScanner<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We want to skip specials when checking if a show is available
|
||||||
const isAllStandardSeasons =
|
const isAllStandardSeasons =
|
||||||
seasons.length &&
|
seasons.length &&
|
||||||
seasons.every(
|
seasons
|
||||||
(season) =>
|
.filter((season) => season.seasonNumber !== 0)
|
||||||
season.episodes === season.totalEpisodes && season.episodes > 0
|
.every(
|
||||||
);
|
(season) =>
|
||||||
|
season.episodes === season.totalEpisodes && season.episodes > 0
|
||||||
|
);
|
||||||
|
|
||||||
const isAll4kSeasons =
|
const isAll4kSeasons =
|
||||||
seasons.length &&
|
seasons.length &&
|
||||||
seasons.every(
|
seasons
|
||||||
(season) =>
|
.filter((season) => season.seasonNumber !== 0)
|
||||||
season.episodes4k === season.totalEpisodes && season.episodes4k > 0
|
.every(
|
||||||
);
|
(season) =>
|
||||||
|
season.episodes4k === season.totalEpisodes &&
|
||||||
|
season.episodes4k > 0
|
||||||
|
);
|
||||||
|
|
||||||
if (media) {
|
if (media) {
|
||||||
media.seasons = [...media.seasons, ...newSeasons];
|
media.seasons = [...media.seasons, ...newSeasons];
|
||||||
@@ -398,15 +404,20 @@ class BaseScanner<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the show is already available, and there are no new seasons, dont adjust
|
// If the show is already available, and there are no new seasons, dont adjust
|
||||||
// the status
|
// the status. Skip specials when performing availability check
|
||||||
const shouldStayAvailable =
|
const shouldStayAvailable =
|
||||||
media.status === MediaStatus.AVAILABLE &&
|
media.status === MediaStatus.AVAILABLE &&
|
||||||
newSeasons.filter((season) => season.status !== MediaStatus.UNKNOWN)
|
newSeasons.filter(
|
||||||
.length === 0;
|
(season) =>
|
||||||
|
season.status !== MediaStatus.UNKNOWN && season.seasonNumber !== 0
|
||||||
|
).length === 0;
|
||||||
const shouldStayAvailable4k =
|
const shouldStayAvailable4k =
|
||||||
media.status4k === MediaStatus.AVAILABLE &&
|
media.status4k === MediaStatus.AVAILABLE &&
|
||||||
newSeasons.filter((season) => season.status4k !== MediaStatus.UNKNOWN)
|
newSeasons.filter(
|
||||||
.length === 0;
|
(season) =>
|
||||||
|
season.status4k !== MediaStatus.UNKNOWN &&
|
||||||
|
season.seasonNumber !== 0
|
||||||
|
).length === 0;
|
||||||
|
|
||||||
media.status =
|
media.status =
|
||||||
isAllStandardSeasons || shouldStayAvailable
|
isAllStandardSeasons || shouldStayAvailable
|
||||||
|
Reference in New Issue
Block a user