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;