From 0f7d29624bbac26eef0792f1e5177c65a2c60492 Mon Sep 17 00:00:00 2001 From: fallenbagel <98979876+fallenbagel@users.noreply.github.com> Date: Tue, 27 Jan 2026 00:58:24 +0500 Subject: [PATCH] fix(availability-sync): handle resolution check for single-server setups (#2334) PR #1543 introduced resolution checking to check 4k from non4k media when users have both server types configured with the same service. Howerver, this causes false deletions for users with only a single non4k service when radarr upgrades file to 4k resolution. This fix only applies resolution to checking when both 4k and non4k servers are configured. Otherwise then if file exists then it counts as available --- server/lib/availabilitySync.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/server/lib/availabilitySync.ts b/server/lib/availabilitySync.ts index 8c7585b3..d9b5244f 100644 --- a/server/lib/availabilitySync.ts +++ b/server/lib/availabilitySync.ts @@ -612,6 +612,13 @@ class AvailabilitySync { ): Promise { let existsInRadarr = false; + const hasSameServerInBothModes = this.radarrServers.some((a) => + this.radarrServers.some( + (b) => + a.is4k !== b.is4k && a.hostname === b.hostname && a.port === b.port + ) + ); + // Check for availability in all of the available radarr servers // If any find the media, we will assume the media exists for (const server of this.radarrServers.filter( @@ -642,7 +649,14 @@ class AvailabilitySync { radarr?.movieFile?.mediaInfo?.resolution?.split('x'); const is4kMovie = resolution?.length === 2 && Number(resolution[0]) >= 2000; - existsInRadarr = is4k ? is4kMovie : !is4kMovie; + + if (hasSameServerInBothModes && resolution?.length === 2) { + // Same server in both modes then use resolution to distinguish + existsInRadarr = is4k ? is4kMovie : !is4kMovie; + } else { + // One server type and if file exists, count it + existsInRadarr = true; + } } } catch (ex) { if (!ex.message.includes('404')) { @@ -658,6 +672,8 @@ class AvailabilitySync { ); } } + + if (existsInRadarr) break; } return existsInRadarr;