Added the request source to the details

pull/4576/head
tidusjar 3 years ago
parent f41eea89a0
commit 268e31c019

@ -143,7 +143,8 @@ namespace Ombi.Core.Engine
RootPathOverride = model.RootFolderOverride.GetValueOrDefault(), RootPathOverride = model.RootFolderOverride.GetValueOrDefault(),
QualityOverride = model.QualityPathOverride.GetValueOrDefault(), QualityOverride = model.QualityPathOverride.GetValueOrDefault(),
RequestedDate4k = model.Is4kRequest ? DateTime.Now : DateTime.MinValue, RequestedDate4k = model.Is4kRequest ? DateTime.Now : DateTime.MinValue,
Is4kRequest = model.Is4kRequest Is4kRequest = model.Is4kRequest,
Source = model.Source
}; };
} }

@ -18,7 +18,7 @@ namespace Ombi.Core.Helpers
{ {
_principle = principle; _principle = principle;
_userManager = userManager; _userManager = userManager;
Identity = _principle?.Identity; Identity = _principle?.Identity ?? null;
} }
public void SetUser(OmbiUser user) public void SetUser(OmbiUser user)
@ -26,7 +26,7 @@ namespace Ombi.Core.Helpers
_user = user; _user = user;
} }
public string Username => Identity.Name; public string Username => Identity?.Name ?? _user?.UserName;
public async Task<OmbiUser> GetUser() public async Task<OmbiUser> GetUser()
{ {
if (!Username.HasValue() && _user == null) if (!Username.HasValue() && _user == null)

@ -104,6 +104,13 @@ export interface IBaseRequest {
canApprove: boolean; canApprove: boolean;
title: string; title: string;
requestedByAlias: string; requestedByAlias: string;
source: RequestSource;
}
export enum RequestSource
{
Ombi = 0,
PlexWatchlist = 1
} }
export interface ITvRequests { export interface ITvRequests {

@ -53,6 +53,11 @@
{{request.requestedDate | amUserLocale | amDateFormat: 'LL'}} {{request.requestedDate | amUserLocale | amDateFormat: 'LL'}}
</div> </div>
<div *ngIf="request && request.source !== RequestSource.Ombi">
<span class="label">{{'MediaDetails.RequestSource' | translate }}</span>
{{RequestSource[request.source]}}
</div>
<div *ngIf="request && request.denied"> <div *ngIf="request && request.denied">
<span class="label">{{'MediaDetails.DeniedReason' | translate }}</span> <span class="label">{{'MediaDetails.DeniedReason' | translate }}</span>
<span id="deniedReasonInfo">{{request.deniedReason}}</span> <span id="deniedReasonInfo">{{request.deniedReason}}</span>

@ -1,6 +1,6 @@
import { Component, ViewEncapsulation, Input, OnInit, Inject } from "@angular/core"; import { Component, ViewEncapsulation, Input, OnInit, Inject } from "@angular/core";
import { ISearchMovieResultV2 } from "../../../../interfaces/ISearchMovieResultV2"; import { ISearchMovieResultV2 } from "../../../../interfaces/ISearchMovieResultV2";
import { IMovieRequests } from "../../../../interfaces"; import { IMovieRequests, RequestSource } from "../../../../interfaces";
import { SearchV2Service } from "../../../../services/searchV2.service"; import { SearchV2Service } from "../../../../services/searchV2.service";
import { IMovieRatings } from "../../../../interfaces/IRatings"; import { IMovieRatings } from "../../../../interfaces/IRatings";
import { APP_BASE_HREF } from "@angular/common"; import { APP_BASE_HREF } from "@angular/common";
@ -21,6 +21,7 @@ export class MovieInformationPanelComponent implements OnInit {
public ratings: IMovieRatings; public ratings: IMovieRatings;
public streams: IStreamingData[]; public streams: IStreamingData[];
public RequestSource = RequestSource;
public baseUrl: string; public baseUrl: string;

@ -379,7 +379,8 @@
"Country": "Country:", "Country": "Country:",
"StartDate": "Start Date:", "StartDate": "Start Date:",
"EndDate": "EndDate:" "EndDate": "EndDate:"
} },
"RequestSource":"Source:"
}, },
"Discovery": { "Discovery": {
"PopularTab": "Popular", "PopularTab": "Popular",

Loading…
Cancel
Save