Skip to content

Commit

Permalink
Small fix around the detection of available Jellyfin movies
Browse files Browse the repository at this point in the history
  • Loading branch information
tidusjar committed Jul 29, 2021
1 parent 924a562 commit 0efb557
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Ombi.Core/Rule/Rules/Search/JellyfinAvailabilityRule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public async Task<RuleResult> Execute(SearchViewModel obj)
var useImdb = false;
var useTheMovieDb = false;
var useTvDb = false;
var useId = false;

if (obj.ImdbId.HasValue())
{
Expand All @@ -39,6 +40,14 @@ public async Task<RuleResult> Execute(SearchViewModel obj)
}
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);
Expand All @@ -63,6 +72,11 @@ public async Task<RuleResult> Execute(SearchViewModel obj)

if (item != null)
{
if (useId)
{
obj.TheMovieDbId = obj.Id.ToString();
useTheMovieDb = true;
}
obj.Available = true;
var s = await JellyfinSettings.GetSettingsAsync();
if (s.Enable)
Expand Down

0 comments on commit 0efb557

Please sign in to comment.