Skip to content

Commit 7e1bb7c

Browse files
committed
feat: set movie status to unknown if unmonitored from radarr during scan
1 parent 64f4610 commit 7e1bb7c

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

server/lib/scanners/baseScanner.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,22 @@ 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+
// For some reason the status of missing movies isn't PENDING but PROCESSING
627+
if (existing && existing.status === MediaStatus.PROCESSING) {
628+
existing.status = MediaStatus.UNKNOWN;
629+
await mediaRepository.save(existing);
630+
this.log(
631+
`Movie TMDB ID ${tmdbId} unmonitored from Radarr. Media status set to UNKNOWN.`,
632+
'info'
633+
);
634+
}
635+
});
636+
}
621637
}
622638

623639
export default BaseScanner;

server/lib/scanners/radarr/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,7 @@ class RadarrScanner
8080

8181
private async processRadarrMovie(radarrMovie: RadarrMovie): Promise<void> {
8282
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-
);
83+
this.processUnmonitoredMovie(radarrMovie.tmdbId);
9084
return;
9185
}
9286

0 commit comments

Comments
 (0)