mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-01 04:08:45 -05:00
fix(media): handle 4K Radarr removal for multiple instances (#2037)
This PR fixes an issue where removing 4K movies from Radarr failed when multiple Radarr instances were configured. The backend was misparsing boolean query parameters and using string slugs instead of TMDB IDs. The fix ensures that the correct 4K Radarr instance is targeted and that TMDB IDs are used for movie removal. Signed-off-by: 0xsysr3ll <0xsysr3ll@pm.me>
This commit is contained in:
@@ -112,7 +112,7 @@ mediaRoutes.post<
|
||||
return next({ status: 404, message: 'Media does not exist.' });
|
||||
}
|
||||
|
||||
const is4k = Boolean(req.body.is4k);
|
||||
const is4k = String(req.body.is4k) === 'true';
|
||||
|
||||
switch (req.params.status) {
|
||||
case 'available':
|
||||
@@ -198,7 +198,7 @@ mediaRoutes.delete(
|
||||
where: { id: Number(req.params.id) },
|
||||
});
|
||||
|
||||
const is4k = req.query.is4k === 'true';
|
||||
const is4k = String(req.query.is4k) === 'true';
|
||||
const isMovie = media.mediaType === MediaType.MOVIE;
|
||||
|
||||
let serviceSettings;
|
||||
@@ -212,18 +212,19 @@ mediaRoutes.delete(
|
||||
);
|
||||
}
|
||||
|
||||
const specificServiceId = is4k ? media.serviceId4k : media.serviceId;
|
||||
if (
|
||||
media.serviceId &&
|
||||
media.serviceId >= 0 &&
|
||||
serviceSettings?.id !== media.serviceId
|
||||
specificServiceId &&
|
||||
specificServiceId >= 0 &&
|
||||
serviceSettings?.id !== specificServiceId
|
||||
) {
|
||||
if (isMovie) {
|
||||
serviceSettings = settings.radarr.find(
|
||||
(radarr) => radarr.id === media.serviceId
|
||||
(radarr) => radarr.id === specificServiceId
|
||||
);
|
||||
} else {
|
||||
serviceSettings = settings.sonarr.find(
|
||||
(sonarr) => sonarr.id === media.serviceId
|
||||
(sonarr) => sonarr.id === specificServiceId
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -257,13 +258,7 @@ mediaRoutes.delete(
|
||||
}
|
||||
|
||||
if (isMovie) {
|
||||
await (service as RadarrAPI).removeMovie(
|
||||
parseInt(
|
||||
is4k
|
||||
? (media.externalServiceSlug4k as string)
|
||||
: (media.externalServiceSlug as string)
|
||||
)
|
||||
);
|
||||
await (service as RadarrAPI).removeMovie(media.tmdbId);
|
||||
} else {
|
||||
const tmdb = new TheMovieDb();
|
||||
const series = await tmdb.getTvShow({ tvId: media.tmdbId });
|
||||
|
||||
Reference in New Issue
Block a user