fix(discover): Fix denied requests displayed as approved (#4901)

pull/4907/head
sephrat 2 years ago committed by GitHub
parent bdc0214e1f
commit 1e87f20104
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,6 +16,7 @@ namespace Ombi.Core.Models.Requests
public string Overview { get; set; }
public DateTime ReleaseDate { get; set; }
public bool Approved { get; set; }
public bool Denied { get; set; }
public string MediaId { get; set; }
public string PosterPath { get; set; }

@ -88,6 +88,7 @@ namespace Ombi.Core.Services
Title = item.Title,
Type = RequestType.Movie,
Approved = item.Approved,
Denied = item.Denied ?? false,
UserId = item.RequestedUserId,
Username = item.RequestedUser.UserAlias,
MediaId = item.TheMovieDbId.ToString(),
@ -108,6 +109,7 @@ namespace Ombi.Core.Services
Available = item.Available,
Overview = item.ArtistName,
Approved = item.Approved,
Denied = item.Denied ?? false,
ReleaseDate = item.ReleaseDate,
RequestDate = item.RequestedDate,
Title = item.Title,
@ -135,6 +137,7 @@ namespace Ombi.Core.Services
Overview = item.ParentRequest.Overview,
ReleaseDate = item.ParentRequest.ReleaseDate,
Approved = item.Approved,
Denied = item.Denied ?? false,
RequestDate = item.RequestedDate,
TvPartiallyAvailable = partialAvailability,
Title = item.ParentRequest.Title,

@ -41,6 +41,9 @@ export class DetailedCardComponent implements OnInit, OnDestroy {
}
public getStatus(request: IRecentlyRequested) {
if (request.denied) {
return "Common.Denied";
}
if (request.available) {
return "Common.Available";
}
@ -63,6 +66,9 @@ export class DetailedCardComponent implements OnInit, OnDestroy {
}
public getClass(request: IRecentlyRequested) {
if (request.denied) {
return "danger";
}
if (request.available || request.tvPartiallyAvailable) {
return "success";
}
@ -113,7 +119,7 @@ export class DetailedCardComponent implements OnInit, OnDestroy {
this.setBackgroundStyle(this.request.background);
return;
}
// Set background style while image path is loading.
this.setBackgroundStyle(null);
switch (this.request.type) {

@ -11,9 +11,10 @@ export interface IRecentlyRequested {
overview: string;
releaseDate: Date;
approved: boolean;
denied: boolean;
mediaId: string;
type: RequestType;
posterPath: string;
background: string;
}
}

Loading…
Cancel
Save