From 0efb55793d0852e3d33e77d3cfa750938b4454ab Mon Sep 17 00:00:00 2001 From: tidusjar Date: Thu, 29 Jul 2021 11:18:14 +0100 Subject: [PATCH] Small fix around the detection of available Jellyfin movies --- .../Rule/Rules/Search/JellyfinAvailabilityRule.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Ombi.Core/Rule/Rules/Search/JellyfinAvailabilityRule.cs b/src/Ombi.Core/Rule/Rules/Search/JellyfinAvailabilityRule.cs index 0447458d9..c51645112 100644 --- a/src/Ombi.Core/Rule/Rules/Search/JellyfinAvailabilityRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/JellyfinAvailabilityRule.cs @@ -28,6 +28,7 @@ namespace Ombi.Core.Rule.Rules.Search var useImdb = false; var useTheMovieDb = false; var useTvDb = false; + var useId = false; if (obj.ImdbId.HasValue()) { @@ -39,6 +40,14 @@ namespace Ombi.Core.Rule.Rules.Search } if (item == null) { + if (obj.Id > 0) + { + item = await JellyfinContentRepository.GetByTheMovieDbId(obj.Id.ToString()); + if (item != null) + { + useId = true; + } + } if (obj.TheMovieDbId.HasValue()) { item = await JellyfinContentRepository.GetByTheMovieDbId(obj.TheMovieDbId); @@ -63,6 +72,11 @@ namespace Ombi.Core.Rule.Rules.Search if (item != null) { + if (useId) + { + obj.TheMovieDbId = obj.Id.ToString(); + useTheMovieDb = true; + } obj.Available = true; var s = await JellyfinSettings.GetSettingsAsync(); if (s.Enable)