Skip to content

Commit 60e5258

Browse files
committed
feat(radarr-scanner): remove unmonitored movies from "requests"
1 parent 002557d commit 60e5258

File tree

11 files changed

+219
-156
lines changed

11 files changed

+219
-156
lines changed

cypress/config/settings.cypress.json

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"enableSpecialEpisodes": false,
2626
"forceIpv4First": false,
2727
"dnsServers": "",
28+
"removeUnmonitoredEnabled": false,
2829
"locale": "en"
2930
},
3031
"plex": {

overseerr-api.yml

+3
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ components:
176176
partialRequestsEnabled:
177177
type: boolean
178178
example: false
179+
removeUnmonitoredEnabled:
180+
type: boolean
181+
example: false
179182
localLogin:
180183
type: boolean
181184
example: true

publish.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#/bin/sh
2+
COMMIT_TAG=`git rev-parse HEAD`
3+
docker build --build-arg COMMIT_TAG=${COMMIT_TAG} -t bonswouar/jellyseerr -f Dockerfile . && docker push bonswouar/jellyseerr

server/interfaces/api/settingsInterfaces.ts

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export interface PublicSettingsResponse {
3838
mediaServerType: number;
3939
partialRequestsEnabled: boolean;
4040
enableSpecialEpisodes: boolean;
41+
removeUnmonitoredEnabled: boolean;
4142
cacheImages: boolean;
4243
vapidPublic: string;
4344
enablePushRegistration: boolean;

server/lib/scanners/baseScanner.ts

+16-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class BaseScanner<T> {
211211

212212
/**
213213
* processShow takes a TMDB ID and an array of ProcessableSeasons, which
214-
* should include the total episodes a sesaon has + the total available
214+
* should include the total episodes a season has + the total available
215215
* episodes that each season currently has. Unlike processMovie, this method
216216
* does not take an `is4k` option. We handle both the 4k _and_ non 4k status
217217
* in one method.
@@ -618,6 +618,21 @@ class BaseScanner<T> {
618618
get protectedBundleSize(): number {
619619
return this.bundleSize;
620620
}
621+
622+
protected async processUnmonitoredMovie(tmdbId: number): Promise<void> {
623+
const mediaRepository = getRepository(Media);
624+
await this.asyncLock.dispatch(tmdbId, async () => {
625+
const existing = await this.getExisting(tmdbId, MediaType.MOVIE);
626+
if (existing && existing.status === MediaStatus.PROCESSING) {
627+
existing.status = MediaStatus.UNKNOWN;
628+
await mediaRepository.save(existing);
629+
this.log(
630+
`Movie TMDB ID ${tmdbId} unmonitored from Radarr. Media status set to UNKNOWN.`,
631+
'info'
632+
);
633+
}
634+
});
635+
}
621636
}
622637

623638
export default BaseScanner;

server/lib/scanners/radarr/index.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,13 @@ class RadarrScanner
7979
}
8080

8181
private async processRadarrMovie(radarrMovie: RadarrMovie): Promise<void> {
82-
if (!radarrMovie.monitored && !radarrMovie.hasFile) {
83-
this.log(
84-
'Title is unmonitored and has not been downloaded. Skipping item.',
85-
'debug',
86-
{
87-
title: radarrMovie.title,
88-
}
89-
);
82+
const settings = getSettings();
83+
if (
84+
settings.main.removeUnmonitoredEnabled &&
85+
!radarrMovie.monitored &&
86+
!radarrMovie.hasFile
87+
) {
88+
this.processUnmonitoredMovie(radarrMovie.tmdbId);
9089
return;
9190
}
9291

server/lib/settings/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export interface MainSettings {
134134
enableSpecialEpisodes: boolean;
135135
forceIpv4First: boolean;
136136
dnsServers: string;
137+
removeUnmonitoredEnabled: boolean;
137138
locale: string;
138139
proxy: ProxySettings;
139140
}
@@ -158,6 +159,7 @@ interface FullPublicSettings extends PublicSettings {
158159
jellyfinServerName?: string;
159160
partialRequestsEnabled: boolean;
160161
enableSpecialEpisodes: boolean;
162+
removeUnmonitoredEnabled: boolean;
161163
cacheImages: boolean;
162164
vapidPublic: string;
163165
enablePushRegistration: boolean;
@@ -350,6 +352,7 @@ class Settings {
350352
enableSpecialEpisodes: false,
351353
forceIpv4First: false,
352354
dnsServers: '',
355+
removeUnmonitoredEnabled: false,
353356
locale: 'en',
354357
proxy: {
355358
enabled: false,
@@ -595,6 +598,7 @@ class Settings {
595598
mediaServerType: this.main.mediaServerType,
596599
partialRequestsEnabled: this.data.main.partialRequestsEnabled,
597600
enableSpecialEpisodes: this.data.main.enableSpecialEpisodes,
601+
removeUnmonitoredEnabled: this.data.main.removeUnmonitoredEnabled,
598602
cacheImages: this.data.main.cacheImages,
599603
vapidPublic: this.vapidPublic,
600604
enablePushRegistration: this.data.notifications.agents.webpush.enabled,

0 commit comments

Comments
 (0)