Compare commits
3 Commits
fix/releas
...
preview-pl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b46a7d8804 | ||
|
|
844f86d41d | ||
|
|
d9aceee3f6 |
@@ -666,6 +666,16 @@ class AvailabilitySync {
|
||||
): Promise<boolean> {
|
||||
let existsInRadarr = false;
|
||||
|
||||
if (is4k && media.status4k === MediaStatus.AVAILABLE) {
|
||||
logger.debug(
|
||||
`Checking if 4K movie [TMDB ID ${media.tmdbId}] exists in Radarr`,
|
||||
{
|
||||
label: 'AvailabilitySync',
|
||||
externalServiceId4k: media.externalServiceId4k,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// 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(
|
||||
@@ -870,6 +880,32 @@ class AvailabilitySync {
|
||||
this.plexSeasonsCache[ratingKey4k] =
|
||||
await this.plexClient?.getChildrenMetadata(ratingKey4k);
|
||||
}
|
||||
|
||||
if (plexMedia) {
|
||||
if (media.mediaType === 'movie') {
|
||||
const has4kByWidth = plexMedia.Media?.some(
|
||||
(mediaItem) => (mediaItem.width ?? 0) >= 2000
|
||||
);
|
||||
|
||||
if (is4k) {
|
||||
if (ratingKey === ratingKey4k || !has4kByWidth) {
|
||||
plexMedia = undefined;
|
||||
}
|
||||
} else {
|
||||
const hasNon4kByWidth = plexMedia.Media?.some(
|
||||
(mediaItem) =>
|
||||
(mediaItem.width ?? 0) < 2000 && (mediaItem.width ?? 0) > 0
|
||||
);
|
||||
if (!hasNon4kByWidth && has4kByWidth) {
|
||||
plexMedia = undefined;
|
||||
}
|
||||
}
|
||||
} else if (media.mediaType === 'tv' && is4k) {
|
||||
if (ratingKey === ratingKey4k) {
|
||||
plexMedia = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (plexMedia) {
|
||||
|
||||
Reference in New Issue
Block a user