Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix denied requests displayed as approved #4901

Merged
merged 1 commit into from
Apr 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Ombi.Core/Models/Requests/RecentlyRequestedModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class RecentlyRequestedModel
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; }
Expand Down
3 changes: 3 additions & 0 deletions src/Ombi.Core/Services/RecentlyRequestedService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public async Task<IEnumerable<RecentlyRequestedModel>> GetRecentlyRequested(Canc
Title = item.Title,
Type = RequestType.Movie,
Approved = item.Approved,
Denied = item.Denied ?? false,
UserId = item.RequestedUserId,
Username = item.RequestedUser.UserAlias,
MediaId = item.TheMovieDbId.ToString(),
Expand All @@ -108,6 +109,7 @@ public async Task<IEnumerable<RecentlyRequestedModel>> GetRecentlyRequested(Canc
Available = item.Available,
Overview = item.ArtistName,
Approved = item.Approved,
Denied = item.Denied ?? false,
ReleaseDate = item.ReleaseDate,
RequestDate = item.RequestedDate,
Title = item.Title,
Expand Down Expand Up @@ -135,6 +137,7 @@ public async Task<IEnumerable<RecentlyRequestedModel>> GetRecentlyRequested(Canc
Overview = item.ParentRequest.Overview,
ReleaseDate = item.ParentRequest.ReleaseDate,
Approved = item.Approved,
Denied = item.Denied ?? false,
RequestDate = item.RequestedDate,
TvPartiallyAvailable = partialAvailability,
Title = item.ParentRequest.Title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand All @@ -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";
}
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion src/Ombi/ClientApp/src/app/interfaces/IRecentlyRequested.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ export interface IRecentlyRequested {
overview: string;
releaseDate: Date;
approved: boolean;
denied: boolean;
mediaId: string;
type: RequestType;

posterPath: string;
background: string;
}
}