mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 15:56:05 -07:00
Reworked the TV model AGAIN #865
This commit is contained in:
parent
25526cc4d9
commit
1b5698b3ca
10 changed files with 141 additions and 114 deletions
|
@ -33,10 +33,11 @@ namespace Ombi.Core.Engine
|
||||||
|
|
||||||
var showInfo = await TvApi.ShowLookupByTheTvDbId(tv.Id);
|
var showInfo = await TvApi.ShowLookupByTheTvDbId(tv.Id);
|
||||||
DateTime.TryParse(showInfo.premiered, out DateTime firstAir);
|
DateTime.TryParse(showInfo.premiered, out DateTime firstAir);
|
||||||
|
|
||||||
// For some reason the poster path is always http
|
// For some reason the poster path is always http
|
||||||
var posterPath = showInfo.image?.medium.Replace("http:", "https:");
|
var posterPath = showInfo.image?.medium.Replace("http:", "https:");
|
||||||
var model = new TvRequestModel
|
|
||||||
|
var childRequest = new ChildTvRequest
|
||||||
{
|
{
|
||||||
Id = tv.Id,
|
Id = tv.Id,
|
||||||
Type = RequestType.TvShow,
|
Type = RequestType.TvShow,
|
||||||
|
@ -49,30 +50,50 @@ namespace Ombi.Core.Engine
|
||||||
Approved = false,
|
Approved = false,
|
||||||
RequestedUsers = new List<string> { Username },
|
RequestedUsers = new List<string> { Username },
|
||||||
Issues = IssueState.None,
|
Issues = IssueState.None,
|
||||||
|
ProviderId = tv.Id,
|
||||||
|
RequestAll = tv.RequestAll,
|
||||||
|
SeasonRequests = tv.SeasonRequests,
|
||||||
|
};
|
||||||
|
|
||||||
|
var model = new TvRequestModel
|
||||||
|
{
|
||||||
|
Id = tv.Id,
|
||||||
|
Type = RequestType.TvShow,
|
||||||
|
Overview = showInfo.summary.RemoveHtml(),
|
||||||
|
PosterPath = posterPath,
|
||||||
|
Title = showInfo.name,
|
||||||
|
ReleaseDate = firstAir,
|
||||||
|
Status = showInfo.status,
|
||||||
|
Approved = false,
|
||||||
ImdbId = showInfo.externals?.imdb ?? string.Empty,
|
ImdbId = showInfo.externals?.imdb ?? string.Empty,
|
||||||
TvDbId = tv.Id.ToString(),
|
TvDbId = tv.Id.ToString(),
|
||||||
ProviderId = tv.Id,
|
ProviderId = tv.Id,
|
||||||
RequestAll = tv.RequestAll
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var episodes = await TvApi.EpisodeLookup(showInfo.id);
|
model.ChildRequests.Add(childRequest);
|
||||||
|
|
||||||
foreach (var e in episodes)
|
if (childRequest.SeasonRequests.Any())
|
||||||
{
|
{
|
||||||
var season = model.SeasonRequests.FirstOrDefault(x => x.SeasonNumber == e.season);
|
var episodes = await TvApi.EpisodeLookup(showInfo.id);
|
||||||
season?.Episodes.Add(new EpisodesRequested
|
|
||||||
|
foreach (var e in episodes)
|
||||||
{
|
{
|
||||||
Url = e.url,
|
var season = childRequest.SeasonRequests.FirstOrDefault(x => x.SeasonNumber == e.season);
|
||||||
Title = e.name,
|
season?.Episodes.Add(new EpisodesRequested
|
||||||
AirDate = DateTime.Parse(e.airstamp),
|
{
|
||||||
EpisodeNumber = e.number,
|
Url = e.url,
|
||||||
});
|
Title = e.name,
|
||||||
|
AirDate = DateTime.Parse(e.airstamp),
|
||||||
|
EpisodeNumber = e.number,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tv.LatestSeason)
|
if (tv.LatestSeason)
|
||||||
{
|
{
|
||||||
var latest = showInfo.Season.OrderBy(x => x.SeasonNumber).FirstOrDefault();
|
var latest = showInfo.Season.OrderBy(x => x.SeasonNumber).FirstOrDefault();
|
||||||
foreach (var modelSeasonRequest in model.SeasonRequests)
|
foreach (var modelSeasonRequest in childRequest.SeasonRequests)
|
||||||
{
|
{
|
||||||
if (modelSeasonRequest.SeasonNumber == latest.SeasonNumber)
|
if (modelSeasonRequest.SeasonNumber == latest.SeasonNumber)
|
||||||
{
|
{
|
||||||
|
@ -86,7 +107,7 @@ namespace Ombi.Core.Engine
|
||||||
if (tv.FirstSeason)
|
if (tv.FirstSeason)
|
||||||
{
|
{
|
||||||
var first = showInfo.Season.OrderByDescending(x => x.SeasonNumber).FirstOrDefault();
|
var first = showInfo.Season.OrderByDescending(x => x.SeasonNumber).FirstOrDefault();
|
||||||
foreach (var modelSeasonRequest in model.SeasonRequests)
|
foreach (var modelSeasonRequest in childRequest.SeasonRequests)
|
||||||
{
|
{
|
||||||
if (modelSeasonRequest.SeasonNumber == first.SeasonNumber)
|
if (modelSeasonRequest.SeasonNumber == first.SeasonNumber)
|
||||||
{
|
{
|
||||||
|
@ -124,20 +145,8 @@ namespace Ombi.Core.Engine
|
||||||
{
|
{
|
||||||
var allRequests = await TvRequestService.GetAllAsync();
|
var allRequests = await TvRequestService.GetAllAsync();
|
||||||
var results = allRequests.FirstOrDefault(x => x.Id == request.Id);
|
var results = allRequests.FirstOrDefault(x => x.Id == request.Id);
|
||||||
|
results = Mapper.Map<TvRequestModel>(request);
|
||||||
results.Approved = request.Approved;
|
|
||||||
results.Available = request.Available;
|
|
||||||
results.Denied = request.Denied;
|
|
||||||
results.DeniedReason = request.DeniedReason;
|
|
||||||
results.AdminNote = request.AdminNote;
|
|
||||||
results.ImdbId = request.ImdbId;
|
|
||||||
results.IssueId = request.IssueId;
|
|
||||||
results.Issues = request.Issues;
|
|
||||||
results.OtherMessage = request.OtherMessage;
|
|
||||||
results.Overview = request.Overview;
|
|
||||||
results.PosterPath = request.PosterPath;
|
|
||||||
results.RequestedUsers = request.RequestedUsers?.ToList() ?? new List<string>();
|
|
||||||
|
|
||||||
var model = TvRequestService.UpdateRequest(results);
|
var model = TvRequestService.UpdateRequest(results);
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
@ -149,38 +158,25 @@ namespace Ombi.Core.Engine
|
||||||
|
|
||||||
private async Task<RequestEngineResult> AddExistingRequest(TvRequestModel newRequest, TvRequestModel existingRequest)
|
private async Task<RequestEngineResult> AddExistingRequest(TvRequestModel newRequest, TvRequestModel existingRequest)
|
||||||
{
|
{
|
||||||
var episodeDifference = new List<SeasonRequestModel>();
|
|
||||||
if (existingRequest.HasChildRequests)
|
var child = newRequest.ChildRequests.FirstOrDefault(); // There will only be 1
|
||||||
|
var episodeDiff = new List<SeasonRequestModel>();
|
||||||
|
foreach (var existingChild in existingRequest.ChildRequests)
|
||||||
{
|
{
|
||||||
// Let's check if this has already been requested as a child!
|
var difference = GetListDifferences(existingChild.SeasonRequests, child.SeasonRequests).ToList();
|
||||||
foreach (var children in existingRequest.ChildRequests)
|
if (difference.Any())
|
||||||
{
|
{
|
||||||
var difference = GetListDifferences(children.SeasonRequests, newRequest.SeasonRequests).ToList();
|
episodeDiff = difference;
|
||||||
if (difference.Any())
|
|
||||||
{
|
|
||||||
episodeDifference = difference;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (episodeDifference.Any())
|
if (episodeDiff.Any())
|
||||||
{
|
{
|
||||||
// This is where there are some episodes that have been requested, but this list contains the 'new' requests
|
// This is where there are some episodes that have been requested, but this list contains the 'new' requests
|
||||||
newRequest.SeasonRequests = episodeDifference;
|
child.SeasonRequests = episodeDiff;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!existingRequest.HasChildRequests)
|
existingRequest.ChildRequests.AddRange(newRequest.ChildRequests);
|
||||||
{
|
|
||||||
// So this is the first child request, we will want to convert the original request to a child
|
|
||||||
var originalRequest = Mapper.Map<TvRequestModel>(existingRequest);
|
|
||||||
existingRequest.ChildRequests.Add(originalRequest);
|
|
||||||
existingRequest.RequestedUsers.Clear();
|
|
||||||
existingRequest.Approved = false;
|
|
||||||
existingRequest.Available = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
existingRequest.ChildRequests.Add(newRequest);
|
|
||||||
|
|
||||||
TvRequestService.UpdateRequest(existingRequest);
|
TvRequestService.UpdateRequest(existingRequest);
|
||||||
|
|
||||||
if (ShouldAutoApprove(RequestType.TvShow))
|
if (ShouldAutoApprove(RequestType.TvShow))
|
||||||
|
@ -207,10 +203,10 @@ namespace Ombi.Core.Engine
|
||||||
{
|
{
|
||||||
await TvRequestService.AddRequestAsync(model);
|
await TvRequestService.AddRequestAsync(model);
|
||||||
|
|
||||||
return await AfterRequest(model);
|
return await AfterRequest(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<RequestEngineResult> AfterRequest(BaseRequestModel model)
|
private async Task<RequestEngineResult> AfterRequest(TvRequestModel model)
|
||||||
{
|
{
|
||||||
if (ShouldSendNotification(model.Type))
|
if (ShouldSendNotification(model.Type))
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace Ombi.Core.Engine
|
||||||
{
|
{
|
||||||
|
|
||||||
public TvSearchEngine(IPrincipal identity, IRequestServiceMain service, ITvMazeApi tvMaze, IMapper mapper, ISettingsService<PlexSettings> plexSettings,
|
public TvSearchEngine(IPrincipal identity, IRequestServiceMain service, ITvMazeApi tvMaze, IMapper mapper, ISettingsService<PlexSettings> plexSettings,
|
||||||
ISettingsService<EmbySettings> embySettings)
|
ISettingsService<EmbySettings> embySettings)
|
||||||
: base(identity, service)
|
: base(identity, service)
|
||||||
{
|
{
|
||||||
TvMazeApi = tvMaze;
|
TvMazeApi = tvMaze;
|
||||||
|
@ -41,7 +41,7 @@ namespace Ombi.Core.Engine
|
||||||
public async Task<IEnumerable<SearchTvShowViewModel>> Search(string searchTerm)
|
public async Task<IEnumerable<SearchTvShowViewModel>> Search(string searchTerm)
|
||||||
{
|
{
|
||||||
var searchResult = await TvMazeApi.Search(searchTerm);
|
var searchResult = await TvMazeApi.Search(searchTerm);
|
||||||
|
|
||||||
if (searchResult != null)
|
if (searchResult != null)
|
||||||
{
|
{
|
||||||
return await ProcessResults(searchResult);
|
return await ProcessResults(searchResult);
|
||||||
|
@ -73,7 +73,7 @@ namespace Ombi.Core.Engine
|
||||||
EpisodeNumber = e.number,
|
EpisodeNumber = e.number,
|
||||||
});
|
});
|
||||||
mapped.SeasonRequests.Add(newSeason);
|
mapped.SeasonRequests.Add(newSeason);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -166,19 +166,23 @@ namespace Ombi.Core.Engine
|
||||||
// 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 item.SeasonRequests)
|
foreach (var season in item.SeasonRequests)
|
||||||
{
|
{
|
||||||
// Find the existing request season
|
foreach (var existingRequestChildRequest in existingRequest.ChildRequests)
|
||||||
var existingSeason =
|
|
||||||
existingRequest.SeasonRequests.FirstOrDefault(x => x.SeasonNumber == season.SeasonNumber);
|
|
||||||
|
|
||||||
foreach (var ep in existingSeason.Episodes)
|
|
||||||
{
|
{
|
||||||
// Find the episode from what we are searching
|
|
||||||
var episodeSearching = season.Episodes.FirstOrDefault(x => x.EpisodeNumber == ep.EpisodeNumber);
|
// Find the existing request season
|
||||||
episodeSearching.Requested = ep.Requested;
|
var existingSeason =
|
||||||
episodeSearching.Available = ep.Available;
|
existingRequestChildRequest.SeasonRequests.FirstOrDefault(x => x.SeasonNumber == season.SeasonNumber);
|
||||||
episodeSearching.Approved = ep.Approved;
|
|
||||||
|
foreach (var ep in existingSeason.Episodes)
|
||||||
|
{
|
||||||
|
// Find the episode from what we are searching
|
||||||
|
var episodeSearching = season.Episodes.FirstOrDefault(x => x.EpisodeNumber == ep.EpisodeNumber);
|
||||||
|
episodeSearching.Requested = ep.Requested;
|
||||||
|
episodeSearching.Available = ep.Available;
|
||||||
|
episodeSearching.Approved = ep.Approved;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if (sonarrCached.Select(x => x.TvdbId).Contains(tvdbid) || sickRageCache.Contains(tvdbid))
|
//if (sonarrCached.Select(x => x.TvdbId).Contains(tvdbid) || sickRageCache.Contains(tvdbid))
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Ombi.Store.Entities;
|
||||||
|
|
||||||
namespace Ombi.Core.Models.Requests
|
namespace Ombi.Core.Models.Requests
|
||||||
{
|
{
|
||||||
|
@ -6,23 +8,13 @@ namespace Ombi.Core.Models.Requests
|
||||||
{
|
{
|
||||||
public TvRequestModel()
|
public TvRequestModel()
|
||||||
{
|
{
|
||||||
SeasonRequests = new List<SeasonRequestModel>();
|
ChildRequests = new List<ChildTvRequest>();
|
||||||
ChildRequests = new List<TvRequestModel>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ImdbId { get; set; }
|
public string ImdbId { get; set; }
|
||||||
public string TvDbId { get; set; }
|
public string TvDbId { get; set; }
|
||||||
public bool RequestAll { get; set; }
|
|
||||||
public List<SeasonRequestModel> SeasonRequests { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This is for TV requests, If there is more than 1 request for a show then it should be a child
|
|
||||||
/// e.g. Request 1 is for Season 1, Request 2 is for season 5. There should be two child items.
|
|
||||||
/// </summary>
|
|
||||||
public List<TvRequestModel> ChildRequests { get; set; }
|
|
||||||
|
|
||||||
public bool HasChildRequests => ChildRequests.Count > 0;
|
|
||||||
|
|
||||||
|
public List<ChildTvRequest> ChildRequests { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For TV Shows with a custom root folder
|
/// For TV Shows with a custom root folder
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -31,4 +23,11 @@ namespace Ombi.Core.Models.Requests
|
||||||
/// </value>
|
/// </value>
|
||||||
public int RootFolderSelected { get; set; }
|
public int RootFolderSelected { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ChildTvRequest : BaseRequestModel
|
||||||
|
{
|
||||||
|
public bool RequestAll { get; set; }
|
||||||
|
public List<SeasonRequestModel> SeasonRequests { get; set; } = new List<SeasonRequestModel>();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -6,9 +6,14 @@ namespace Ombi.Helpers
|
||||||
{
|
{
|
||||||
public class ByteConverterHelper
|
public class ByteConverterHelper
|
||||||
{
|
{
|
||||||
|
private static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
|
||||||
|
{
|
||||||
|
ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
|
||||||
|
PreserveReferencesHandling = PreserveReferencesHandling.Objects
|
||||||
|
};
|
||||||
public static byte[] ReturnBytes(object obj)
|
public static byte[] ReturnBytes(object obj)
|
||||||
{
|
{
|
||||||
var json = JsonConvert.SerializeObject(obj);
|
var json = JsonConvert.SerializeObject(obj, Settings);
|
||||||
var bytes = Encoding.UTF8.GetBytes(json);
|
var bytes = Encoding.UTF8.GetBytes(json);
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
|
@ -17,7 +22,7 @@ namespace Ombi.Helpers
|
||||||
public static T ReturnObject<T>(byte[] bytes)
|
public static T ReturnObject<T>(byte[] bytes)
|
||||||
{
|
{
|
||||||
var json = Encoding.UTF8.GetString(bytes);
|
var json = Encoding.UTF8.GetString(bytes);
|
||||||
var model = JsonConvert.DeserializeObject<T>(json);
|
var model = JsonConvert.DeserializeObject<T>(json, Settings);
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public static string ReturnFromBytes(byte[] bytes)
|
public static string ReturnFromBytes(byte[] bytes)
|
||||||
|
|
2
src/Ombi/.gitignore
vendored
2
src/Ombi/.gitignore
vendored
|
@ -4,6 +4,8 @@
|
||||||
/wwwroot/maps/**
|
/wwwroot/maps/**
|
||||||
/wwwroot/app/**/*.js
|
/wwwroot/app/**/*.js
|
||||||
/wwwroot/app/**/*.js.map
|
/wwwroot/app/**/*.js.map
|
||||||
|
/wwwroot/*.js.map
|
||||||
|
/wwwroot/*.js
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
/node_modules
|
/node_modules
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
@ -55,7 +56,16 @@ namespace Ombi.Controllers
|
||||||
[HttpGet("tv/{count:int}/{position:int}")]
|
[HttpGet("tv/{count:int}/{position:int}")]
|
||||||
public async Task<IEnumerable<TvRequestModel>> GetTvRequests(int count, int position)
|
public async Task<IEnumerable<TvRequestModel>> GetTvRequests(int count, int position)
|
||||||
{
|
{
|
||||||
return await TvRequestEngine.GetTvRequests(count, position);
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
return await TvRequestEngine.GetTvRequests(count, position);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("tv")]
|
[HttpPost("tv")]
|
||||||
|
|
|
@ -12,6 +12,11 @@
|
||||||
<Content Include="wwwroot\**" />
|
<Content Include="wwwroot\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Remove="wwwroot/systemjs.config.js.map" />
|
||||||
|
<Content Remove="wwwroot\systemjs.config.js" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
issueId: number,
|
issueId: number,
|
||||||
denied: boolean,
|
denied: boolean,
|
||||||
deniedReason: string,
|
deniedReason: string,
|
||||||
released:boolean
|
released: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IMovieRequestModel extends IMediaBase {
|
export interface IMovieRequestModel extends IMediaBase {
|
||||||
|
@ -28,16 +28,17 @@ export interface IMovieRequestModel extends IMediaBase {
|
||||||
export interface ITvRequestModel extends IMediaBase {
|
export interface ITvRequestModel extends IMediaBase {
|
||||||
imdbId: string,
|
imdbId: string,
|
||||||
tvDbId: string,
|
tvDbId: string,
|
||||||
requestAll: boolean,
|
childRequests: IChildTvRequest[]
|
||||||
seasonRequests: ISeasonRequests[],
|
|
||||||
childRequests: ITvRequestModel[],
|
|
||||||
hasChildRequests: boolean,
|
|
||||||
rootFolderSelected: number,
|
rootFolderSelected: number,
|
||||||
firstAired:string,
|
firstAired: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ISeasonRequests
|
export interface IChildTvRequest extends IMediaBase {
|
||||||
{
|
requestAll: boolean,
|
||||||
|
seasonRequests: ISeasonRequests[],
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ISeasonRequests {
|
||||||
seasonNumber: number,
|
seasonNumber: number,
|
||||||
episodes: IEpisodesRequested[],
|
episodes: IEpisodesRequested[],
|
||||||
}
|
}
|
||||||
|
@ -49,7 +50,7 @@ export interface IEpisodesRequested {
|
||||||
url: string,
|
url: string,
|
||||||
requested: boolean,
|
requested: boolean,
|
||||||
status: string,
|
status: string,
|
||||||
available:boolean
|
available: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,5 +61,5 @@ export enum RequestType {
|
||||||
|
|
||||||
export interface IRequestsPageScroll {
|
export interface IRequestsPageScroll {
|
||||||
count: number,
|
count: number,
|
||||||
position:number
|
position: number
|
||||||
}
|
}
|
|
@ -77,29 +77,29 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!--Child Requests-->
|
<!--Child Requests-->
|
||||||
<div *ngIf="request.hasChildRequests">
|
|
||||||
|
|
||||||
<button type="button" class="btn btn-sm btn-info-outline" data-toggle="collapse" [attr.data-target]="'#' + request.id +'childRequests'">Children</button>
|
|
||||||
<div id="{{request.id}}childRequests" class="collapse">
|
|
||||||
|
|
||||||
<div *ngFor="let child of request.childRequests">
|
<button type="button" class="btn btn-sm btn-info-outline" data-toggle="collapse" [attr.data-target]="'#' + request.id +'childRequests'">Children</button>
|
||||||
<hr/>
|
<div id="{{request.id}}childRequests" class="collapse">
|
||||||
<div *ngIf="request.requestedUsers">Requested By: <span *ngFor="let user of request.requestedUsers">{{user}} </span>
|
|
||||||
</div>
|
|
||||||
<div>Seasons Requested: <span *ngFor="let s of request.seasonNumbersRequested">{{s}} </span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span>Request status: </span>
|
|
||||||
<span *ngIf="request.available" class="label label-success">Available</span>
|
|
||||||
<span *ngIf="request.approved && !request.available" class="label label-info">Processing Request</span>
|
|
||||||
<span *ngIf="request.denied" class="label label-danger">Request Denied</span>
|
|
||||||
<span *ngIf="request.deniedReason" title="{{request.deniedReason}}"><i class="fa fa-info-circle"></i></span>
|
|
||||||
<span *ngIf="!request.approved && !request.availble && !request.denied" class="label label-warning">Pending Approval</span>
|
|
||||||
|
|
||||||
</div>
|
<div *ngFor="let child of request.childRequests">
|
||||||
|
<hr />
|
||||||
|
<div *ngIf="request.requestedUsers">
|
||||||
|
Requested By: <span *ngFor="let user of request.requestedUsers">{{user}} </span>
|
||||||
</div>
|
</div>
|
||||||
|
<div *ngIf="child.seasonRequests">
|
||||||
|
Seasons Requested: <span *ngFor="let s of child.seasonRequests">{{s.seasonNumber}} </span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span>Request status: </span>
|
||||||
|
<span *ngIf="request.available" class="label label-success">Available</span>
|
||||||
|
<span *ngIf="request.approved && !request.available" class="label label-info">Processing Request</span>
|
||||||
|
<span *ngIf="request.denied" class="label label-danger">Request Denied</span>
|
||||||
|
<span *ngIf="request.deniedReason" title="{{request.deniedReason}}"><i class="fa fa-info-circle"></i></span>
|
||||||
|
<span *ngIf="!request.approved && !request.availble && !request.denied" class="label label-warning">Pending Approval</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -114,6 +114,7 @@
|
||||||
<span class="caret"></span>
|
<span class="caret"></span>
|
||||||
<span class="sr-only">Toggle Dropdown</span>
|
<span class="sr-only">Toggle Dropdown</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<!--<ul class="dropdown-menu">
|
<!--<ul class="dropdown-menu">
|
||||||
{{#each qualities}}
|
{{#each qualities}}
|
||||||
<li><a href="#" class="approve-with-quality" id="{{id}}">{{name}}</a></li>
|
<li><a href="#" class="approve-with-quality" id="{{id}}">{{name}}</a></li>
|
||||||
|
@ -127,6 +128,10 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--<form method="POST" action="@formAction/requests/changeRootFolder{{#if_eq type "tv"}}tv{{else}}movie{{/if_eq}}" id="changeFolder{{requestId}}">
|
<!--<form method="POST" action="@formAction/requests/changeRootFolder{{#if_eq type "tv"}}tv{{else}}movie{{/if_eq}}" id="changeFolder{{requestId}}">
|
||||||
<input name="requestId" type="text" value="{{requestId}}" hidden="hidden"/>
|
<input name="requestId" type="text" value="{{requestId}}" hidden="hidden"/>
|
||||||
{{#if_eq hasRootFolders true}}
|
{{#if_eq hasRootFolders true}}
|
||||||
|
|
|
@ -17,4 +17,4 @@
|
||||||
|
|
||||||
System.import('bundle').then(() => {
|
System.import('bundle').then(() => {
|
||||||
System.import('/app/main');
|
System.import('/app/main');
|
||||||
})
|
})
|
Loading…
Add table
Add a link
Reference in a new issue