diff --git a/src/Ombi.Core/Rule/Rules/Search/ExistingRule.cs b/src/Ombi.Core/Rule/Rules/Search/ExistingRule.cs index 45e74c3af..a7cd43336 100644 --- a/src/Ombi.Core/Rule/Rules/Search/ExistingRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/ExistingRule.cs @@ -75,6 +75,7 @@ namespace Ombi.Core.Rule.Rules.Search episodeSearching.Requested = true; episodeSearching.Available = ep.Available; episodeSearching.Approved = ep.Season.ChildRequest.Approved; + episodeSearching.Denied = request.Denied; } } } diff --git a/src/Ombi.Store/Entities/Requests/ChildRequests.cs b/src/Ombi.Store/Entities/Requests/ChildRequests.cs index f212aa3e7..9d4376452 100644 --- a/src/Ombi.Store/Entities/Requests/ChildRequests.cs +++ b/src/Ombi.Store/Entities/Requests/ChildRequests.cs @@ -30,6 +30,35 @@ namespace Ombi.Store.Entities.Requests public List Issues { get; set; } public List SeasonRequests { get; set; } + + [NotMapped] + public string RequestStatus + { + get + { + if (Available) + { + return "Common.Available"; + } + + if (Denied ?? false) + { + return "Common.Denied"; + } + + if (Approved & !Available) + { + return "Common.ProcessingRequest"; + } + + if (!Approved && !Available) + { + return "Common.PendingApproval"; + } + + return string.Empty; + } + } } public enum SeriesType diff --git a/src/Ombi.Store/Entities/Requests/SeasonRequests.cs b/src/Ombi.Store/Entities/Requests/SeasonRequests.cs index 8a9fabf08..0d8d587a5 100644 --- a/src/Ombi.Store/Entities/Requests/SeasonRequests.cs +++ b/src/Ombi.Store/Entities/Requests/SeasonRequests.cs @@ -29,6 +29,8 @@ namespace Ombi.Store.Repository.Requests public bool Available { get; set; } public bool Approved { get; set; } public bool Requested { get; set; } + [NotMapped] + public bool? Denied { get; set; } public int SeasonId { get; set; } [ForeignKey(nameof(SeasonId))] @@ -46,12 +48,17 @@ namespace Ombi.Store.Repository.Requests return "Common.Available"; } + if (Denied ?? false) + { + return "Common.Denied"; + } + if (Approved & !Available) { return "Common.ProcessingRequest"; } - if (!Approved && !Available && Requested) + if (!Approved && !Available) { return "Common.PendingApproval"; } diff --git a/src/Ombi/ClientApp/src/app/interfaces/IRequestModel.ts b/src/Ombi/ClientApp/src/app/interfaces/IRequestModel.ts index 3c2626cf5..440e0d5b2 100644 --- a/src/Ombi/ClientApp/src/app/interfaces/IRequestModel.ts +++ b/src/Ombi/ClientApp/src/app/interfaces/IRequestModel.ts @@ -130,6 +130,7 @@ export interface IChildRequests extends IBaseRequest { parentRequest: ITvRequests; subscribed: boolean; showSubscribe: boolean; + requestStatus: string; } export interface ITvUpdateModel { @@ -168,6 +169,7 @@ export interface IEpisodesRequests { requested: boolean; approved: boolean; requestStatus: string; + denied: boolean; selected: boolean; // This is for the UI only } diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-request-grid/tv-request-grid.component.scss b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-request-grid/tv-request-grid.component.scss index d96f849d8..b585dc939 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-request-grid/tv-request-grid.component.scss +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-request-grid/tv-request-grid.component.scss @@ -41,4 +41,9 @@ .top-right.requested span:before{ display: inline-block; background-color: #ffd740; + } + + .top-right.denied span:before{ + display: inline-block; + background-color: #ff4040; } \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-request-grid/tv-request-grid.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-request-grid/tv-request-grid.component.ts index 0a103c75a..3e34b98f9 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-request-grid/tv-request-grid.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-request-grid/tv-request-grid.component.ts @@ -191,6 +191,13 @@ export class TvRequestGridComponent { return "available"; } + const allDenied = season.episodes.every((ep) => { + return ep.denied; + }); + if (allDenied) { + return "denied"; + } + const seasonPending = season.episodes.some((ep) => { return ep.requested && !ep.approved }); @@ -212,6 +219,10 @@ export class TvRequestGridComponent { return "available"; } + if (ep.denied) { + return "denied"; + } + if (ep.requested && !ep.approved) { return "requested"; } diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-requests/tv-requests-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-requests/tv-requests-panel.component.html index c7db6af5d..719bafc8d 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-requests/tv-requests-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-requests/tv-requests-panel.component.html @@ -2,16 +2,7 @@ -
{{'Common.ProcessingRequest' | translate}}
-
{{'Common.Denied' | translate}}
-
- {{'Common.PendingApproval' | translate}} -
-
- {{'Common.NotRequested' | translate}} -
-
{{'Common.Available' | translate}} -
+
{{ request.requestStatus | translate }}
{{'Requests.RequestedBy' | translate}} '{{request.requestedUser.userAlias}}' on @@ -45,15 +36,7 @@ {{ 'Requests.GridStatus' | translate }} - - - - - -
-
-
+ {{ request.requestStatus | translate }}
diff --git a/src/Ombi/ClientApp/src/app/requests-list/components/tv-grid/tv-grid.component.html b/src/Ombi/ClientApp/src/app/requests-list/components/tv-grid/tv-grid.component.html index b9c256985..7dff24660 100644 --- a/src/Ombi/ClientApp/src/app/requests-list/components/tv-grid/tv-grid.component.html +++ b/src/Ombi/ClientApp/src/app/requests-list/components/tv-grid/tv-grid.component.html @@ -50,12 +50,7 @@ {{'Requests.RequestStatus' | translate}} - -
{{'Common.ProcessingRequest' | translate}}
-
{{'Common.PendingApproval' |translate}}
-
{{'Common.Available' | translate}}
- - + {{element.requestStatus | translate}}