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:
0xsysr3ll
2025-10-28 17:25:57 +01:00
committed by GitHub
parent efc9b00d39
commit 7dfa30a151
2 changed files with 35 additions and 15 deletions

View File

@@ -150,6 +150,31 @@ const ManageSlideOver = ({
return false;
};
const isDefault4kService = () => {
if (data.mediaInfo) {
if (data.mediaInfo.mediaType === MediaType.MOVIE) {
return (
radarrData?.find(
(radarr) =>
radarr.isDefault &&
radarr.is4k &&
radarr.id === data.mediaInfo?.serviceId4k
) !== undefined
);
} else {
return (
sonarrData?.find(
(sonarr) =>
sonarr.isDefault &&
sonarr.is4k &&
sonarr.id === data.mediaInfo?.serviceId4k
) !== undefined
);
}
}
return false;
};
const markAvailable = async (is4k = false) => {
if (data.mediaInfo) {
await axios.post(`/api/v1/media/${data.mediaInfo?.id}/available`, {
@@ -572,7 +597,7 @@ const ManageSlideOver = ({
</span>
</Button>
</a>
{isDefaultService() && (
{isDefault4kService() && (
<div>
<ConfirmButton
onClick={() => deleteMediaFile(true)}