mirror of
https://github.com/sct/overseerr.git
synced 2025-09-29 21:51:46 +02:00
fix: availability sync requests (#3460)
* fix: modified media status handling when media has been deleted fix: requests will now be updated to completed on scan fix: modified components to display deleted as a status fix: corrected media status switching away from deleted fix: modified components to display deleted as a status fix: corrected media status switching away from deleted fix: base scanner will set requests to completed correctly fix: mark available button correctly sets requests as completed fix: status will now stay deleted after declined request refactor: request completion handling moved to entity fix: prevented notifications from sending to old deleted requests refactor: cleaned up code and added more detail to logs refactor: updated to reflect latest availability sync changes * fix: fetch requests only if necessary in db and remove unneeded code * fix: update request button logic to accomodate specials fix: remove completed filtering in tv details * fix: correctly set seasons status when using the manual button * refactor: improve reliability of season request completion refactor: remove seasonrequest code * fix: send notification for 4k movies fix: same for shows * feat: add completed filter to requests list refactor: correct label
This commit is contained in:
@@ -281,7 +281,9 @@ class BaseScanner<T> {
|
||||
? MediaStatus.AVAILABLE
|
||||
: season.episodes > 0
|
||||
? MediaStatus.PARTIALLY_AVAILABLE
|
||||
: !season.is4kOverride && season.processing
|
||||
: !season.is4kOverride &&
|
||||
season.processing &&
|
||||
existingSeason.status !== MediaStatus.DELETED
|
||||
? MediaStatus.PROCESSING
|
||||
: existingSeason.status;
|
||||
|
||||
@@ -294,7 +296,9 @@ class BaseScanner<T> {
|
||||
? MediaStatus.AVAILABLE
|
||||
: this.enable4kShow && season.episodes4k > 0
|
||||
? MediaStatus.PARTIALLY_AVAILABLE
|
||||
: season.is4kOverride && season.processing
|
||||
: season.is4kOverride &&
|
||||
season.processing &&
|
||||
existingSeason.status4k !== MediaStatus.DELETED
|
||||
? MediaStatus.PROCESSING
|
||||
: existingSeason.status4k;
|
||||
} else {
|
||||
@@ -409,16 +413,18 @@ class BaseScanner<T> {
|
||||
media.status === MediaStatus.AVAILABLE &&
|
||||
newSeasons.filter(
|
||||
(season) =>
|
||||
season.status !== MediaStatus.UNKNOWN && season.seasonNumber !== 0
|
||||
season.status !== MediaStatus.UNKNOWN &&
|
||||
season.status !== MediaStatus.DELETED &&
|
||||
season.seasonNumber !== 0
|
||||
).length === 0;
|
||||
const shouldStayAvailable4k =
|
||||
media.status4k === MediaStatus.AVAILABLE &&
|
||||
newSeasons.filter(
|
||||
(season) =>
|
||||
season.status4k !== MediaStatus.UNKNOWN &&
|
||||
season.status4k !== MediaStatus.DELETED &&
|
||||
season.seasonNumber !== 0
|
||||
).length === 0;
|
||||
|
||||
media.status =
|
||||
isAllStandardSeasons || shouldStayAvailable
|
||||
? MediaStatus.AVAILABLE
|
||||
@@ -428,11 +434,13 @@ class BaseScanner<T> {
|
||||
season.status === MediaStatus.AVAILABLE
|
||||
)
|
||||
? MediaStatus.PARTIALLY_AVAILABLE
|
||||
: !seasons.length ||
|
||||
: (!seasons.length && media.status !== MediaStatus.DELETED) ||
|
||||
media.seasons.some(
|
||||
(season) => season.status === MediaStatus.PROCESSING
|
||||
)
|
||||
? MediaStatus.PROCESSING
|
||||
: media.status === MediaStatus.DELETED
|
||||
? MediaStatus.DELETED
|
||||
: MediaStatus.UNKNOWN;
|
||||
media.status4k =
|
||||
(isAll4kSeasons || shouldStayAvailable4k) && this.enable4kShow
|
||||
@@ -444,11 +452,13 @@ class BaseScanner<T> {
|
||||
season.status4k === MediaStatus.AVAILABLE
|
||||
)
|
||||
? MediaStatus.PARTIALLY_AVAILABLE
|
||||
: !seasons.length ||
|
||||
: (!seasons.length && media.status4k !== MediaStatus.DELETED) ||
|
||||
media.seasons.some(
|
||||
(season) => season.status4k === MediaStatus.PROCESSING
|
||||
)
|
||||
? MediaStatus.PROCESSING
|
||||
: media.status4k === MediaStatus.DELETED
|
||||
? MediaStatus.DELETED
|
||||
: MediaStatus.UNKNOWN;
|
||||
await mediaRepository.save(media);
|
||||
this.log(`Updating existing title: ${title}`);
|
||||
|
Reference in New Issue
Block a user