Fixed the NRO error !wip

pull/2696/head
TidusJar 6 years ago
parent 0cc57c3c1f
commit 2fdfa3be97

@ -9,9 +9,9 @@ using Ombi.Store.Repository.Requests;
namespace Ombi.Core.Rule.Rules.Search
{
public abstract class AvailabilityRuleBase : BaseSearchRule
public static class AvailabilityRuleHelper
{
public void CheckForUnairedEpisodes(SearchTvShowViewModel search)
public static void CheckForUnairedEpisodes(SearchTvShowViewModel search)
{
if (search.SeasonRequests.All(x => x.Episodes.All(e => e.Available)))
{
@ -33,7 +33,7 @@ namespace Ombi.Core.Rule.Rules.Search
}
}
public async Task SingleEpisodeCheck(bool useImdb, IQueryable<PlexEpisode> allEpisodes, EpisodeRequests episode,
public static async Task SingleEpisodeCheck(bool useImdb, IQueryable<PlexEpisode> allEpisodes, EpisodeRequests episode,
SeasonRequests season, PlexServerContent item, bool useTheMovieDb, bool useTvDb)
{
PlexEpisode epExists = null;

@ -9,7 +9,7 @@ using Ombi.Store.Repository;
namespace Ombi.Core.Rule.Rules.Search
{
public class EmbyAvailabilityRule : AvailabilityRuleBase, IRules<SearchViewModel>
public class EmbyAvailabilityRule : BaseSearchRule, IRules<SearchViewModel>
{
public EmbyAvailabilityRule(IEmbyContentRepository repo)
{
@ -73,12 +73,12 @@ namespace Ombi.Core.Rule.Rules.Search
{
foreach (var episode in season.Episodes)
{
await SingleEpisodeCheck(useImdb, allEpisodes, episode, season, item, useTheMovieDb, useTvDb);
await AvailabilityRuleHelper.SingleEpisodeCheck(useImdb, allEpisodes, episode, season, item, useTheMovieDb, useTvDb);
}
}
}
CheckForUnairedEpisodes(search);
AvailabilityRuleHelper.CheckForUnairedEpisodes(search);
}
}
return Success();

@ -8,7 +8,7 @@ using Ombi.Store.Repository;
namespace Ombi.Core.Rule.Rules.Search
{
public class PlexAvailabilityRule : AvailabilityRuleBase, IRules<SearchViewModel>
public class PlexAvailabilityRule : BaseSearchRule, IRules<SearchViewModel>
{
public PlexAvailabilityRule(IPlexContentRepository repo)
{
@ -72,11 +72,11 @@ namespace Ombi.Core.Rule.Rules.Search
{
foreach (var episode in season.Episodes)
{
await SingleEpisodeCheck(useImdb, allEpisodes, episode, season, item, useTheMovieDb, useTvDb);
await AvailabilityRuleHelper.SingleEpisodeCheck(useImdb, allEpisodes, episode, season, item, useTheMovieDb, useTvDb);
}
}
CheckForUnairedEpisodes(search);
AvailabilityRuleHelper.CheckForUnairedEpisodes(search);
}
}
}

Loading…
Cancel
Save