mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 13:23:20 -07:00
fix(mediaserver): fixed some more issues in the media server sync and availability checks
This commit is contained in:
parent
3b0ba18f1b
commit
f3ea979b8b
6 changed files with 46 additions and 4 deletions
|
@ -82,6 +82,13 @@ namespace Ombi.Core.Rule.Rules.Search
|
|||
obj.EmbyUrl = item.Url;
|
||||
obj.Quality = item.Quality;
|
||||
}
|
||||
|
||||
if (item.Quality.HasValue())
|
||||
{
|
||||
obj.Available = true;
|
||||
obj.EmbyUrl = item.Url;
|
||||
obj.Quality = item.Quality;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -88,13 +88,20 @@ namespace Ombi.Core.Rule.Rules.Search
|
|||
{
|
||||
movie.Available4K = true;
|
||||
obj.JellyfinUrl = item.Url;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.Available = true;
|
||||
obj.EmbyUrl = item.Url;
|
||||
obj.Quality = item.Quality;
|
||||
}
|
||||
|
||||
if (item.Quality.HasValue())
|
||||
{
|
||||
obj.Available = true;
|
||||
obj.EmbyUrl = item.Url;
|
||||
obj.Quality = item.Quality;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -3,9 +3,11 @@ using System.Threading.Tasks;
|
|||
using Microsoft.Extensions.Logging;
|
||||
using Ombi.Core.Models.Search;
|
||||
using Ombi.Core.Rule.Interfaces;
|
||||
using Ombi.Core.Services;
|
||||
using Ombi.Core.Settings;
|
||||
using Ombi.Core.Settings.Models.External;
|
||||
using Ombi.Helpers;
|
||||
using Ombi.Settings.Settings.Models;
|
||||
using Ombi.Store.Entities;
|
||||
using Ombi.Store.Repository;
|
||||
|
||||
|
@ -14,12 +16,15 @@ namespace Ombi.Core.Rule.Rules.Search
|
|||
public class PlexAvailabilityRule : BaseSearchRule, IRules<SearchViewModel>
|
||||
{
|
||||
private readonly ISettingsService<PlexSettings> _plexSettings;
|
||||
private readonly IFeatureService _featureService;
|
||||
|
||||
public PlexAvailabilityRule(IPlexContentRepository repo, ILogger<PlexAvailabilityRule> log, ISettingsService<PlexSettings> plexSettings)
|
||||
public PlexAvailabilityRule(IPlexContentRepository repo, ILogger<PlexAvailabilityRule> log, ISettingsService<PlexSettings> plexSettings,
|
||||
IFeatureService featureService)
|
||||
{
|
||||
PlexContentRepository = repo;
|
||||
Log = log;
|
||||
_plexSettings = plexSettings;
|
||||
_featureService = featureService;
|
||||
}
|
||||
|
||||
private IPlexContentRepository PlexContentRepository { get; }
|
||||
|
@ -92,10 +97,17 @@ namespace Ombi.Core.Rule.Rules.Search
|
|||
|
||||
if (obj is SearchMovieViewModel movie)
|
||||
{
|
||||
if (item.Has4K)
|
||||
var is4kEnabled = await _featureService.FeatureEnabled(FeatureNames.Movie4KRequests);
|
||||
|
||||
if (item.Has4K && is4kEnabled)
|
||||
{
|
||||
movie.Available4K = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.Available = true;
|
||||
obj.Quality = item.Quality;
|
||||
}
|
||||
|
||||
if (item.Quality.HasValue())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue