mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-30 03:28:28 -07:00
Enhance display of denied TV shows
This commit is contained in:
parent
d933196cf0
commit
0523c9a3f1
7 changed files with 20 additions and 1 deletions
|
@ -308,6 +308,9 @@ namespace Ombi.Core.Engine.V2
|
||||||
item.PartlyAvailable = oldModel.PartlyAvailable;
|
item.PartlyAvailable = oldModel.PartlyAvailable;
|
||||||
item.Requested = oldModel.Requested;
|
item.Requested = oldModel.Requested;
|
||||||
item.Available = oldModel.Available;
|
item.Available = oldModel.Available;
|
||||||
|
item.Denied = oldModel.Denied;
|
||||||
|
item.DeniedReason = oldModel.DeniedReason;
|
||||||
|
item.FullyDenied = oldModel.FullyDenied;
|
||||||
item.Approved = oldModel.Approved;
|
item.Approved = oldModel.Approved;
|
||||||
item.SeasonRequests = oldModel.SeasonRequests;
|
item.SeasonRequests = oldModel.SeasonRequests;
|
||||||
item.RequestId = oldModel.RequestId;
|
item.RequestId = oldModel.RequestId;
|
||||||
|
|
|
@ -56,6 +56,7 @@ namespace Ombi.Core.Models.Search
|
||||||
public bool FullyAvailable { get; set; }
|
public bool FullyAvailable { get; set; }
|
||||||
// We only have some episodes
|
// We only have some episodes
|
||||||
public bool PartlyAvailable { get; set; }
|
public bool PartlyAvailable { get; set; }
|
||||||
|
public bool FullyDenied { get; set; }
|
||||||
public override RequestType Type => RequestType.TvShow;
|
public override RequestType Type => RequestType.TvShow;
|
||||||
|
|
||||||
public string BackdropPath { get; set; }
|
public string BackdropPath { get; set; }
|
||||||
|
|
|
@ -48,6 +48,7 @@ namespace Ombi.Core.Models.Search.V2
|
||||||
public bool FullyAvailable { get; set; }
|
public bool FullyAvailable { get; set; }
|
||||||
// We only have some episodes
|
// We only have some episodes
|
||||||
public bool PartlyAvailable { get; set; }
|
public bool PartlyAvailable { get; set; }
|
||||||
|
public bool FullyDenied { get; set; }
|
||||||
public override RequestType Type => RequestType.TvShow;
|
public override RequestType Type => RequestType.TvShow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@ namespace Ombi.Core.Rule.Rules.Search
|
||||||
request.Requested = true;
|
request.Requested = true;
|
||||||
request.Approved = tvRequests.ChildRequests.Any(x => x.Approved);
|
request.Approved = tvRequests.ChildRequests.Any(x => x.Approved);
|
||||||
request.Denied = tvRequests.ChildRequests.Any(x => x.Denied ?? false);
|
request.Denied = tvRequests.ChildRequests.Any(x => x.Denied ?? false);
|
||||||
|
request.DeniedReason = tvRequests.ChildRequests.FirstOrDefault(x => x.Denied == true).DeniedReason;
|
||||||
|
|
||||||
// Let's modify the seasonsrequested to reflect what we have requested...
|
// Let's modify the seasonsrequested to reflect what we have requested...
|
||||||
foreach (var season in request.SeasonRequests)
|
foreach (var season in request.SeasonRequests)
|
||||||
|
@ -100,6 +101,11 @@ namespace Ombi.Core.Rule.Rules.Search
|
||||||
request.PartlyAvailable = true;
|
request.PartlyAvailable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (request.SeasonRequests.Any() && request.SeasonRequests.All(x => x.Episodes.All(e => e.Denied ?? false)))
|
||||||
|
{
|
||||||
|
request.FullyDenied = true;
|
||||||
|
}
|
||||||
|
|
||||||
var hasUnairedRequests = request.SeasonRequests.Any() && request.SeasonRequests.All(x => x.Episodes.Any(e => e.AirDate >= DateTime.UtcNow));
|
var hasUnairedRequests = request.SeasonRequests.Any() && request.SeasonRequests.All(x => x.Episodes.Any(e => e.AirDate >= DateTime.UtcNow));
|
||||||
|
|
||||||
if (request.FullyAvailable)
|
if (request.FullyAvailable)
|
||||||
|
|
|
@ -206,6 +206,7 @@ export class DiscoverCardComponent implements OnInit {
|
||||||
this.result.overview = updated.overview;
|
this.result.overview = updated.overview;
|
||||||
this.result.approved = updated.approved;
|
this.result.approved = updated.approved;
|
||||||
this.result.available = updated.fullyAvailable;
|
this.result.available = updated.fullyAvailable;
|
||||||
|
this.result.denied = updated.fullyDenied;
|
||||||
|
|
||||||
this.fullyLoaded = true;
|
this.fullyLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,9 @@ export interface ISearchTvResultV2 {
|
||||||
seasonRequests: INewSeasonRequests[];
|
seasonRequests: INewSeasonRequests[];
|
||||||
requestAll: boolean;
|
requestAll: boolean;
|
||||||
approved: boolean;
|
approved: boolean;
|
||||||
|
denied: boolean;
|
||||||
|
deniedReason: string;
|
||||||
|
fullyDenied: boolean;
|
||||||
requested: boolean;
|
requested: boolean;
|
||||||
available: boolean;
|
available: boolean;
|
||||||
plexUrl: string;
|
plexUrl: string;
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
(click)="request()"><i class="fas fa-plus"></i>
|
(click)="request()"><i class="fas fa-plus"></i>
|
||||||
{{ 'Common.Request' | translate }}</button>
|
{{ 'Common.Request' | translate }}</button>
|
||||||
|
|
||||||
<button *ngIf="allEpisodesRequested()" mat-raised-button class="btn-spacing" color="warn" [disabled]>
|
<button *ngIf="!tv.fullyDenied && allEpisodesRequested()" mat-raised-button class="btn-spacing" color="warn" [disabled]>
|
||||||
<i class="fas fa-check"></i>
|
<i class="fas fa-check"></i>
|
||||||
{{ 'Common.Requested' | translate }}</button>
|
{{ 'Common.Requested' | translate }}</button>
|
||||||
|
|
||||||
|
@ -83,6 +83,10 @@
|
||||||
<i class="fas fa-check"></i> {{'Common.PartiallyAvailable' | translate }}</button>
|
<i class="fas fa-check"></i> {{'Common.PartiallyAvailable' | translate }}</button>
|
||||||
<!-- end unaired episodes-->
|
<!-- end unaired episodes-->
|
||||||
|
|
||||||
|
<button id="deniedButton" *ngIf="tv.fullyDenied" [matTooltip]="tv.deniedReason" mat-raised-button class="btn-spacing" color="warn">
|
||||||
|
<i class="fas fa-times"></i> {{'Common.Denied' | translate }}
|
||||||
|
</button>
|
||||||
|
|
||||||
<button mat-raised-button class="btn-spacing" color="danger" id="reportIssueBtn" *ngIf="issuesEnabled" (click)="issue()">
|
<button mat-raised-button class="btn-spacing" color="danger" id="reportIssueBtn" *ngIf="issuesEnabled" (click)="issue()">
|
||||||
<i class="fas fa-exclamation"></i> {{
|
<i class="fas fa-exclamation"></i> {{
|
||||||
'Requests.ReportIssue' | translate }}</button>
|
'Requests.ReportIssue' | translate }}</button>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue