mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-24 02:39:18 -05:00
fix(jellyfin-scanner): add imdbId handling back to fix a regression from original behaviour
This commit is contained in:
@@ -35,6 +35,7 @@ interface ProcessOptions {
|
||||
mediaAddedAt?: Date;
|
||||
ratingKey?: string;
|
||||
jellyfinMediaId?: string;
|
||||
imdbId?: string;
|
||||
serviceId?: number;
|
||||
externalServiceId?: number;
|
||||
externalServiceSlug?: string;
|
||||
@@ -97,6 +98,7 @@ class BaseScanner<T> {
|
||||
mediaAddedAt,
|
||||
ratingKey,
|
||||
jellyfinMediaId,
|
||||
imdbId,
|
||||
serviceId,
|
||||
externalServiceId,
|
||||
externalServiceSlug,
|
||||
@@ -185,6 +187,7 @@ class BaseScanner<T> {
|
||||
} else {
|
||||
const newMedia = new Media();
|
||||
newMedia.tmdbId = tmdbId;
|
||||
newMedia.imdbId = imdbId;
|
||||
|
||||
newMedia.status =
|
||||
!is4k && !processing
|
||||
@@ -277,7 +280,7 @@ class BaseScanner<T> {
|
||||
(es) => es.seasonNumber === season.seasonNumber
|
||||
);
|
||||
|
||||
// We update the rating keys in the seasons loop because we need episode counts
|
||||
// We update the rating keys and jellyfinMediaId in the seasons loop because we need episode counts
|
||||
if (media && season.episodes > 0 && media.ratingKey !== ratingKey) {
|
||||
media.ratingKey = ratingKey;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ class JellyfinScanner
|
||||
imdbId = result?.imdbId;
|
||||
}
|
||||
|
||||
if (imdbId && isNaN(tmdbId)) {
|
||||
if (imdbId && !tmdbId) {
|
||||
const tmdbMovie = await this.tmdb.getMediaByImdbId({
|
||||
imdbId: imdbId,
|
||||
});
|
||||
@@ -123,7 +123,7 @@ class JellyfinScanner
|
||||
const extracted = await this.extractMovieIds(jellyfinitem);
|
||||
if (!extracted) return;
|
||||
|
||||
const { tmdbId, metadata } = extracted;
|
||||
const { tmdbId, imdbId, metadata } = extracted;
|
||||
|
||||
const has4k = metadata.MediaSources?.some((MediaSource) => {
|
||||
return MediaSource.MediaStreams.filter(
|
||||
@@ -150,6 +150,7 @@ class JellyfinScanner
|
||||
is4k: false,
|
||||
mediaAddedAt,
|
||||
jellyfinMediaId: metadata.Id,
|
||||
imdbId,
|
||||
title: metadata.Name,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user