From 106a46dea5f69b8d79022e5ab31ecd32ed54922a Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Fri, 6 Oct 2017 08:32:37 +0100 Subject: [PATCH] Added a PartlyAvailable flag for tv shows --- src/Ombi.Core/Models/Search/SearchTvShowViewModel.cs | 2 ++ src/Ombi.Core/Rule/Rules/Search/ExistingRule.cs | 4 ++++ src/Ombi/ClientApp/app/search/tvsearch.component.html | 1 + 3 files changed, 7 insertions(+) diff --git a/src/Ombi.Core/Models/Search/SearchTvShowViewModel.cs b/src/Ombi.Core/Models/Search/SearchTvShowViewModel.cs index 90f32eda6..46a79aaf8 100644 --- a/src/Ombi.Core/Models/Search/SearchTvShowViewModel.cs +++ b/src/Ombi.Core/Models/Search/SearchTvShowViewModel.cs @@ -55,6 +55,8 @@ namespace Ombi.Core.Models.Search /// This is where we have EVERY Episode for that series /// public bool FullyAvailable { get; set; } + // We only have some episodes + public bool PartlyAvailable { get; set; } public override RequestType Type => RequestType.TvShow; } diff --git a/src/Ombi.Core/Rule/Rules/Search/ExistingRule.cs b/src/Ombi.Core/Rule/Rules/Search/ExistingRule.cs index 4a5faad6b..aee7c37e4 100644 --- a/src/Ombi.Core/Rule/Rules/Search/ExistingRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/ExistingRule.cs @@ -87,6 +87,10 @@ namespace Ombi.Core.Rule.Rules.Search { request.FullyAvailable = true; } + if (request.SeasonRequests.Any() && request.SeasonRequests.All(x => x.Episodes.Any(e => e.Approved))) + { + request.PartlyAvailable = true; + } return Task.FromResult(Success()); diff --git a/src/Ombi/ClientApp/app/search/tvsearch.component.html b/src/Ombi/ClientApp/app/search/tvsearch.component.html index c144e2433..8c45e1508 100644 --- a/src/Ombi/ClientApp/app/search/tvsearch.component.html +++ b/src/Ombi/ClientApp/app/search/tvsearch.component.html @@ -62,6 +62,7 @@ Available + Partially Available HomePage