TV Request stuff

pull/1425/head
Jamie.Rees 8 years ago
parent e0d5b03c7a
commit e24d305c85

Binary file not shown.

@ -1,16 +1,16 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using TraktApiSharp.Enums;
using TraktApiSharp.Objects.Get.Shows;
using TraktApiSharp.Objects.Get.Shows.Common;
//using TraktApiSharp.Enums;
//using TraktApiSharp.Objects.Get.Shows;
//using TraktApiSharp.Objects.Get.Shows.Common;
namespace Ombi.Api.Trakt
{
public interface ITraktApi
{
Task<IEnumerable<TraktMostAnticipatedShow>> GetAnticipatedShows(int? page = default(int?), int? limitPerPage = default(int?));
Task<IEnumerable<TraktMostWatchedShow>> GetMostWatchesShows(TraktTimePeriod period = null, int? page = default(int?), int? limitPerPage = default(int?));
Task<IEnumerable<TraktShow>> GetPopularShows(int? page = default(int?), int? limitPerPage = default(int?));
Task<IEnumerable<TraktTrendingShow>> GetTrendingShows(int? page = default(int?), int? limitPerPage = default(int?));
//Task<IEnumerable<TraktMostAnticipatedShow>> GetAnticipatedShows(int? page = default(int?), int? limitPerPage = default(int?));
//Task<IEnumerable<TraktMostWatchedShow>> GetMostWatchesShows(TraktTimePeriod period = null, int? page = default(int?), int? limitPerPage = default(int?));
//Task<IEnumerable<TraktShow>> GetPopularShows(int? page = default(int?), int? limitPerPage = default(int?));
//Task<IEnumerable<TraktTrendingShow>> GetTrendingShows(int? page = default(int?), int? limitPerPage = default(int?));
}
}

@ -9,10 +9,4 @@
<ProjectReference Include="..\Ombi.Helpers\Ombi.Helpers.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="TraktApiSharp">
<HintPath>..\Assemblies\TraktApiSharp.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

@ -1,49 +1,49 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Ombi.Helpers;
using TraktApiSharp;
using TraktApiSharp.Enums;
using TraktApiSharp.Objects.Get.Shows;
using TraktApiSharp.Objects.Get.Shows.Common;
using TraktApiSharp.Requests.Parameters;
//using System;
//using System.Collections.Generic;
//using System.Threading.Tasks;
//using Ombi.Helpers;
//using TraktApiSharp;
//using TraktApiSharp.Enums;
//using TraktApiSharp.Objects.Get.Shows;
//using TraktApiSharp.Objects.Get.Shows.Common;
//using TraktApiSharp.Requests.Parameters;
namespace Ombi.Api.Trakt
{
public class TraktApi : ITraktApi
{
private TraktClient Client { get; }
//namespace Ombi.Api.Trakt
//{
// public class TraktApi : ITraktApi
// {
// private TraktClient Client { get; }
private static readonly string Encrypted = "MTM0ZTU2ODM1MGY3NDI3NTExZTI1N2E2NTM0MDI2NjYwNDgwY2Y5YjkzYzc3ZjczNzhmMzQwNjAzYjY3MzgxZA==";
private readonly string _apiKey = StringCipher.DecryptString(Encrypted, "ApiKey");
public TraktApi()
{
Client = new TraktClient(_apiKey);
}
// private static readonly string Encrypted = "MTM0ZTU2ODM1MGY3NDI3NTExZTI1N2E2NTM0MDI2NjYwNDgwY2Y5YjkzYzc3ZjczNzhmMzQwNjAzYjY3MzgxZA==";
// private readonly string _apiKey = StringCipher.DecryptString(Encrypted, "ApiKey");
// public TraktApi()
// {
// Client = new TraktClient(_apiKey);
// }
public async Task<IEnumerable<TraktShow>> GetPopularShows(int? page = null, int? limitPerPage = null)
{
var popular = await Client.Shows.GetPopularShowsAsync(new TraktExtendedInfo { Full = true }, null, page ?? 1, limitPerPage ?? 10);
return popular.Value;
}
// public async Task<IEnumerable<TraktShow>> GetPopularShows(int? page = null, int? limitPerPage = null)
// {
// var popular = await Client.Shows.GetPopularShowsAsync(new TraktExtendedInfo { Full = true }, null, page ?? 1, limitPerPage ?? 10);
// return popular.Value;
// }
public async Task<IEnumerable<TraktTrendingShow>> GetTrendingShows(int? page = null, int? limitPerPage = null)
{
var trendingShowsTop10 = await Client.Shows.GetTrendingShowsAsync(new TraktExtendedInfo { Full = true }, null, page ?? 1, limitPerPage ?? 10);
return trendingShowsTop10.Value;
}
// public async Task<IEnumerable<TraktTrendingShow>> GetTrendingShows(int? page = null, int? limitPerPage = null)
// {
// var trendingShowsTop10 = await Client.Shows.GetTrendingShowsAsync(new TraktExtendedInfo { Full = true }, null, page ?? 1, limitPerPage ?? 10);
// return trendingShowsTop10.Value;
// }
public async Task<IEnumerable<TraktMostAnticipatedShow>> GetAnticipatedShows(int? page = null, int? limitPerPage = null)
{
var anticipatedShows = await Client.Shows.GetMostAnticipatedShowsAsync(new TraktExtendedInfo { Full = true }, null, page ?? 1, limitPerPage ?? 10);
return anticipatedShows.Value;
}
// public async Task<IEnumerable<TraktMostAnticipatedShow>> GetAnticipatedShows(int? page = null, int? limitPerPage = null)
// {
// var anticipatedShows = await Client.Shows.GetMostAnticipatedShowsAsync(new TraktExtendedInfo { Full = true }, null, page ?? 1, limitPerPage ?? 10);
// return anticipatedShows.Value;
// }
public async Task<IEnumerable<TraktMostWatchedShow>> GetMostWatchesShows(TraktTimePeriod period = null, int? page = null, int? limitPerPage = null)
{
var anticipatedShows = await Client.Shows.GetMostWatchedShowsAsync(period ?? TraktTimePeriod.Monthly, new TraktExtendedInfo { Full = true }, null, page ?? 1, limitPerPage ?? 10);
return anticipatedShows.Value;
}
}
}
// public async Task<IEnumerable<TraktMostWatchedShow>> GetMostWatchesShows(TraktTimePeriod period = null, int? page = null, int? limitPerPage = null)
// {
// var anticipatedShows = await Client.Shows.GetMostWatchedShowsAsync(period ?? TraktTimePeriod.Monthly, new TraktExtendedInfo { Full = true }, null, page ?? 1, limitPerPage ?? 10);
// return anticipatedShows.Value;
// }
// }
//}

@ -6,6 +6,13 @@
<ItemGroup>
<ProjectReference Include="..\Ombi.Api\Ombi.Api.csproj" />
<ProjectReference Include="..\Ombi.Helpers\Ombi.Helpers.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Extensions.Logging.Abstractions">
<HintPath>..\..\..\..\..\.nuget\packages\microsoft.extensions.logging.abstractions\1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

@ -2,19 +2,24 @@
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Ombi.Api.TvMaze.Models;
using Ombi.Helpers;
namespace Ombi.Api.TvMaze
{
public class TvMazeApi : ITvMazeApi
{
public TvMazeApi()
public TvMazeApi(ILogger<TvMazeApi> logger)
{
Api = new Ombi.Api.Api();
Logger = logger;
//Mapper = mapper;
}
private string Uri = "http://api.tvmaze.com";
private Api Api { get; }
private ILogger<TvMazeApi> Logger { get; }
public async Task<List<TvMazeSearch>> Search(string searchTerm)
{
var request = new Request("search/shows", Uri, HttpMethod.Get);
@ -28,7 +33,7 @@ namespace Ombi.Api.TvMaze
public async Task<TvMazeShow> ShowLookup(int showId)
{
var request = new Request($"shows/{showId}", Uri, HttpMethod.Get);
request.AddHeader("Content-Type", "application/json");
request.AddContentHeader("Content-Type", "application/json");
return await Api.Request<TvMazeShow>(request);
}
@ -38,7 +43,7 @@ namespace Ombi.Api.TvMaze
var request = new Request($"shows/{showId}/episodes", Uri, HttpMethod.Get);
request.AddHeader("Content-Type", "application/json");
request.AddContentHeader("Content-Type", "application/json");
return await Api.Request<List<TvMazeEpisodes>>(request);
}
@ -46,7 +51,7 @@ namespace Ombi.Api.TvMaze
public async Task<TvMazeShow> ShowLookupByTheTvDbId(int theTvDbId)
{
var request = new Request($"lookup/shows?thetvdb={theTvDbId}", Uri, HttpMethod.Get);
request.AddHeader("Content-Type", "application/json");
request.AddContentHeader("Content-Type", "application/json");
try
{
var obj = await Api.Request<TvMazeShow>(request);
@ -66,7 +71,7 @@ namespace Ombi.Api.TvMaze
}
catch (Exception e)
{
// TODO
Logger.LogError(LoggingEvents.ApiException, e, "Exception when calling ShowLookupByTheTvDbId with id:{0}",theTvDbId);
return null;
}
}
@ -75,7 +80,7 @@ namespace Ombi.Api.TvMaze
{
var request = new Request($"shows/{id}/seasons", Uri, HttpMethod.Get);
request.AddHeader("Content-Type", "application/json");
request.AddContentHeader("Content-Type", "application/json");
return await Api.Request<List<TvMazeSeasons>>(request);
}

@ -7,9 +7,9 @@ namespace Ombi.Core.Engine
public interface ITvSearchEngine
{
Task<IEnumerable<SearchTvShowViewModel>> Search(string searchTerm);
Task<IEnumerable<SearchTvShowViewModel>> Popular();
Task<IEnumerable<SearchTvShowViewModel>> Anticipated();
Task<IEnumerable<SearchTvShowViewModel>> MostWatches();
Task<IEnumerable<SearchTvShowViewModel>> Trending();
//Task<IEnumerable<SearchTvShowViewModel>> Popular();
//Task<IEnumerable<SearchTvShowViewModel>> Anticipated();
//Task<IEnumerable<SearchTvShowViewModel>> MostWatches();
//Task<IEnumerable<SearchTvShowViewModel>> Trending();
}
}

@ -35,6 +35,7 @@ namespace Ombi.Core.Engine
var posterPath = showInfo.image?.medium.Replace("http:", "https:");
var model = new TvRequestModel
{
Id = tv.Id,
Type = RequestType.TvShow,
Overview = showInfo.summary.RemoveHtml(),
PosterPath = posterPath,

@ -18,21 +18,21 @@ namespace Ombi.Core.Engine
{
public TvSearchEngine(IPrincipal identity, IRequestServiceMain service, ITvMazeApi tvMaze, IMapper mapper, ISettingsService<PlexSettings> plexSettings,
ISettingsService<EmbySettings> embySettings, ITraktApi trakt)
ISettingsService<EmbySettings> embySettings)
: base(identity, service)
{
TvMazeApi = tvMaze;
Mapper = mapper;
PlexSettings = plexSettings;
EmbySettings = embySettings;
TraktApi = trakt;
//TraktApi = trakt;
}
private ITvMazeApi TvMazeApi { get; }
private IMapper Mapper { get; }
private ISettingsService<PlexSettings> PlexSettings { get; }
private ISettingsService<EmbySettings> EmbySettings { get; }
private ITraktApi TraktApi { get; }
//private ITraktApi TraktApi { get; }
public async Task<IEnumerable<SearchTvShowViewModel>> Search(string searchTerm)
@ -46,27 +46,27 @@ namespace Ombi.Core.Engine
return null;
}
public async Task<IEnumerable<SearchTvShowViewModel>> Popular()
{
var result = await TraktApi.GetPopularShows();
return await ProcessResults(result);
}
//public async Task<IEnumerable<SearchTvShowViewModel>> Popular()
//{
// var result = await TraktApi.GetPopularShows();
// return await ProcessResults(result);
//}
public async Task<IEnumerable<SearchTvShowViewModel>> Anticipated()
{
var result = await TraktApi.GetAnticipatedShows();
return await ProcessResults(result);
}
public async Task<IEnumerable<SearchTvShowViewModel>> MostWatches()
{
var result = await TraktApi.GetMostWatchesShows();
return await ProcessResults(result);
}
public async Task<IEnumerable<SearchTvShowViewModel>> Trending()
{
var result = await TraktApi.GetTrendingShows();
return await ProcessResults(result);
}
//public async Task<IEnumerable<SearchTvShowViewModel>> Anticipated()
//{
// var result = await TraktApi.GetAnticipatedShows();
// return await ProcessResults(result);
//}
//public async Task<IEnumerable<SearchTvShowViewModel>> MostWatches()
//{
// var result = await TraktApi.GetMostWatchesShows();
// return await ProcessResults(result);
//}
//public async Task<IEnumerable<SearchTvShowViewModel>> Trending()
//{
// var result = await TraktApi.GetTrendingShows();
// return await ProcessResults(result);
//}
private async Task<IEnumerable<SearchTvShowViewModel>> ProcessResults<T>(IEnumerable<T> items)
{

@ -12,9 +12,7 @@ namespace Ombi.Core.Requests.Models
void BatchDelete(IEnumerable<T> model);
void BatchUpdate(IEnumerable<T> model);
T CheckRequest(int providerId);
T CheckRequest(string musicId);
Task<T> CheckRequestAsync(int providerId);
Task<T> CheckRequestAsync(string musicId);
void DeleteRequest(T request);
Task DeleteRequestAsync(int request);
Task DeleteRequestAsync(T request);

@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using Ombi.Core.Requests.Models;
using Ombi.Helpers;
@ -8,12 +9,14 @@ using Ombi.Store.Repository;
namespace Ombi.Core.Models.Requests
{
public class JsonRequestService<T> : IRequestService<T> where T:BaseRequestModel
public class JsonRequestService<T> : IRequestService<T> where T : BaseRequestModel
{
public JsonRequestService(IRequestRepository repo)
{
Repo = repo;
RequestType = typeof(T) == typeof(TvRequestModel) ? RequestType.TvShow : RequestType.Movie;
}
private RequestType RequestType { get; }
private IRequestRepository Repo { get; }
public int AddRequest(T model)
{
@ -28,37 +31,15 @@ namespace Ombi.Core.Models.Requests
var entity = new RequestBlobs { Type = model.Type, Content = ByteConverterHelper.ReturnBytes(model), ProviderId = model.ProviderId };
var id = await Repo.InsertAsync(entity).ConfigureAwait(false);
return id.Id;
return id.Id;
}
public T CheckRequest(int providerId)
{
var blobs = Repo.GetAll();
var blob = blobs.FirstOrDefault(x => x.ProviderId == providerId); if (blob == null)
{
return null;
}
var model = ByteConverterHelper.ReturnObject<T>(blob.Content);
model.Id = blob.Id;
return model;
}
var blob = blobs.FirstOrDefault(x => x.ProviderId == providerId && x.Type == RequestType);
public async Task<T> CheckRequestAsync(int providerId)
{
var blobs = await Repo.GetAllAsync().ConfigureAwait(false);
var blob = blobs.FirstOrDefault(x => x.ProviderId == providerId); if (blob == null)
{
return null;
}
var model = ByteConverterHelper.ReturnObject<T>(blob.Content);
model.Id = blob.Id;
return model;
}
public T CheckRequest(string musicId)
{
var blobs = Repo.GetAll();
var blob = blobs.FirstOrDefault(x => x.MusicId == musicId); if (blob == null)
if (blob == null)
{
return null;
}
@ -67,12 +48,10 @@ namespace Ombi.Core.Models.Requests
return model;
}
public async Task<T> CheckRequestAsync(string musicId)
public async Task<T> CheckRequestAsync(int providerId)
{
var blobs = await Repo.GetAllAsync().ConfigureAwait(false);
var blob = blobs.FirstOrDefault(x => x.MusicId == musicId);
if (blob == null)
var blob = blobs.FirstOrDefault(x => x.ProviderId == providerId && x.Type == RequestType); if (blob == null)
{
return null;
}
@ -133,7 +112,7 @@ namespace Ombi.Core.Models.Requests
public IEnumerable<T> GetAll()
{
var blobs = Repo.GetAll().ToList();
var blobs = Repo.GetAll().Where(x => x.Type == RequestType).ToList();
var retVal = new List<T>();
foreach (var b in blobs)
@ -154,7 +133,7 @@ namespace Ombi.Core.Models.Requests
var blobs = await Repo.GetAllAsync().ConfigureAwait(false);
var retVal = new List<T>();
foreach (var b in blobs)
foreach (var b in blobs.Where(x => x.Type == RequestType))
{
if (b == null)
{
@ -172,7 +151,7 @@ namespace Ombi.Core.Models.Requests
var blobs = await Repo.GetAllAsync(count, position).ConfigureAwait(false);
var retVal = new List<T>();
foreach (var b in blobs)
foreach (var b in blobs.Where(x => x.Type == RequestType))
{
if (b == null)
{

@ -26,10 +26,4 @@
<ProjectReference Include="..\Ombi.TheMovieDbApi\Ombi.Api.TheMovieDb.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="TraktApiSharp">
<HintPath>..\Assemblies\TraktApiSharp.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

@ -10,7 +10,6 @@ using Ombi.Api.Emby;
using Ombi.Api.Plex;
using Ombi.Api.Sonarr;
using Ombi.Api.TheMovieDb;
//using Ombi.Api.Trakt;
using Ombi.Api.TvMaze;
using Ombi.Core;
using Ombi.Core.Engine;
@ -59,7 +58,6 @@ namespace Ombi.DependencyInjection
services.AddTransient<IEmbyApi, EmbyApi>();
services.AddTransient<ISonarrApi, SonarrApi>();
services.AddTransient<ITvMazeApi, TvMazeApi>();
//services.AddTransient<ITraktApi, TraktApi>();
return services;
}

@ -0,0 +1,9 @@
using Microsoft.Extensions.Logging;
namespace Ombi.Helpers
{
public class LoggingEvents
{
public static EventId ApiException => new EventId(1000);
}
}

@ -10,4 +10,10 @@
<PackageReference Include="System.Security.Claims" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Extensions.Logging.Abstractions">
<HintPath>..\..\..\..\..\.nuget\packages\microsoft.extensions.logging.abstractions\1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

@ -65,25 +65,25 @@ namespace Ombi.Controllers
return await TvEngine.Search(searchTerm);
}
[HttpGet("tv/popular")]
public async Task<IEnumerable<SearchTvShowViewModel>> PopularTv()
{
return await TvEngine.Popular();
}
[HttpGet("tv/anticiplated")]
public async Task<IEnumerable<SearchTvShowViewModel>> AnticiplatedTv()
{
return await TvEngine.Anticipated();
}
[HttpGet("tv/mostwatched")]
public async Task<IEnumerable<SearchTvShowViewModel>> MostWatched()
{
return await TvEngine.MostWatches();
}
[HttpGet("tv/trending")]
public async Task<IEnumerable<SearchTvShowViewModel>> Trending()
{
return await TvEngine.Trending();
}
//[HttpGet("tv/popular")]
//public async Task<IEnumerable<SearchTvShowViewModel>> PopularTv()
//{
// return await TvEngine.Popular();
//}
//[HttpGet("tv/anticiplated")]
//public async Task<IEnumerable<SearchTvShowViewModel>> AnticiplatedTv()
//{
// return await TvEngine.Anticipated();
//}
//[HttpGet("tv/mostwatched")]
//public async Task<IEnumerable<SearchTvShowViewModel>> MostWatched()
//{
// return await TvEngine.MostWatches();
//}
//[HttpGet("tv/trending")]
//public async Task<IEnumerable<SearchTvShowViewModel>> Trending()
//{
// return await TvEngine.Trending();
//}
}
}

@ -48,12 +48,6 @@
<ProjectReference Include="..\Ombi.TheMovieDbApi\Ombi.Api.TheMovieDb.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="TraktApiSharp">
<HintPath>..\Assemblies\TraktApiSharp.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Update="wwwroot\app\interfaces\ISearchMovieResult - Copy.js">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>

@ -6,7 +6,7 @@ enum envs {
live = 2
}
var envVar = '0';
var envVar = '{something}';
var env = envs.local;
if (envs[envVar]) {
env = envs[envVar];

@ -17,8 +17,7 @@
<div class="row">
<div class="col-sm-2">
<img *ngIf="request.type == 1" class="img-responsive" src="https://image.tmdb.org/t/p/w150/{{request.posterPath}}" alt="poster">
<img *ngIf="request.type == 2" class="img-responsive" src="https://image.tmdb.org/t/p/w150/{{request.posterPath}}" alt="poster">
<img class="img-responsive" src="https://image.tmdb.org/t/p/w150/{{request.posterPath}}" alt="poster">
</div>

@ -17,8 +17,7 @@
<div class="row">
<div class="col-sm-2">
<img *ngIf="request.type == 1" class="img-responsive" src="https://image.tmdb.org/t/p/w150/{{request.posterPath}}" alt="poster">
<img *ngIf="request.type == 2" class="img-responsive" src="https://image.tmdb.org/t/p/w150/{{request.posterPath}}" alt="poster">
<img class="img-responsive" src="{{request.posterPath}}" alt="poster">
</div>
@ -75,6 +74,30 @@
@UI.Issues_Issue: <a href="@formAction/issues/{{issueId}}"><i class="fa fa-check"></i></a>
{{/if_eq}}
</div>-->
<!--Child Requests-->
<div *ngIf="request.hasChildRequests">
<button type="button" class="btn btn-info" 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">
<hr/>
<div *ngIf="request.requestedUsers">Requested By: <span *ngFor="let user of request.requestedUsers">{{user}} </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 class="col-sm-3 col-sm-push-3">
<div *ngIf="isAdmin">

@ -91,7 +91,9 @@ export class TvRequestsComponent implements OnInit {
}
private loadInit() {
this.requestService.getTvRequests(this.amountToLoad, 0).subscribe(x => this.tvRequests = x);
this.requestService.getTvRequests(this.amountToLoad, 0).subscribe(x => {
this.tvRequests = x;
});
this.isAdmin = this.identityService.hasRole("Admin");
}

@ -22,6 +22,10 @@
<br />
<!-- Movie content -->
<div id="movieList">
<div *ngIf="searchApplied && movieResults?.length <= 0" class='no-search-results'>
<i class='fa fa-film no-search-results-icon'></i><div class='no-search-results-text'>Sorry, we didn't find any results!</div>
</div>
<div *ngFor="let result of movieResults">
<div class="row">
<div id="{{id}}imgDiv" class="col-sm-2">
@ -61,22 +65,22 @@
<a *ngIf="result.trailer" href="{{result.trailer}}" target="_blank"><span class="label label-info">Trailer</span></a>
<br />
<br />
<br/>
<br/>
</div>
<p style="font-size:0.9rem !important">{{result.overview}}</p>
<p style="font-size: 0.9rem !important">{{result.overview}}</p>
</div>
<div class="col-sm-2">
<input name="{{type}}Id" type="text" value="{{result.id}}" hidden="hidden" />
<input name="{{type}}Id" type="text" value="{{result.id}}" hidden="hidden"/>
<div *ngIf="result.available">
<button style="text-align: right" class="btn btn-success-outline disabled" disabled><i class="fa fa-check"></i> Available</button>
<div *ngIf="result.url">
<br />
<br />
<br/>
<br/>
<a style="text-align: right" class="btn btn-sm btn-primary-outline" href="{{result.url}}" target="_blank"><i class="fa fa-eye"></i> View In Plex</a>
</div>
@ -92,7 +96,7 @@
<!--{{#if_eq type "tv"}}
{{#if_eq tvFullyAvailable true}}
@*//TODO Not used yet*@
<button style="text-align: right" class="btn btn-success-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Available</button><br />
<button style="text-align: right" class="btn btn-success-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Available</button><br/>
{{else}}
{{#if_eq enableTvRequestsForOnlySeries true}}
<button id="{{id}}" style="text-align: right" class="btn {{#if available}}btn-success-outline{{else}}btn-primary-outline dropdownTv{{/if}} btn-primary-outline" season-select="0" type="button" {{#if available}} disabled{{/if}}><i class="fa fa-plus"></i> {{#if available}}@UI.Search_Available{{else}}@UI.Search_Request{{/if}}</button>
@ -117,7 +121,7 @@
{{/if_eq}}
{{#if available}}
{{#if url}}
<br />
<br/>
<a style="text-align: right" class="btn btn-sm btn-primary-outline" href="{{url}}" target="_blank"><i class="fa fa-eye"></i> @UI.Search_ViewInPlex</a>
{{/if}}
{{/if}}
@ -125,10 +129,10 @@
{{/if_eq}}-->
<br />
<br/>
<div *ngIf="result.available">
<input name="providerId" type="text" value="{{id}}" hidden="hidden" />
<input name="type" type="text" value="{{type}}" hidden="hidden" />
<input name="providerId" type="text" value="{{id}}" hidden="hidden"/>
<input name="type" type="text" value="{{type}}" hidden="hidden"/>
<div class="dropdown">
<button class="btn btn-sm btn-danger-outline dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-exclamation"></i> @UI.Search_ReportIssue
@ -147,7 +151,7 @@
</div>
</div>
<hr />
<hr/>
</div>
</div>

@ -22,6 +22,7 @@ export class MovieSearchComponent implements OnInit {
searchChanged: Subject<string> = new Subject<string>();
movieResults: ISearchMovieResult[];
result: IRequestEngineResult;
searchApplied = false;
constructor(private searchService: SearchService, private requestService: RequestService, private notificationService: NotificationService) {
this.searchChanged
@ -35,7 +36,7 @@ export class MovieSearchComponent implements OnInit {
}
this.searchService.searchMovie(this.searchText).subscribe(x => {
this.movieResults = x;
this.searchApplied = true;
// Now let's load some exta info including IMDBId
// This way the search is fast at displaying results.
this.getExtaInfo();
@ -105,6 +106,7 @@ export class MovieSearchComponent implements OnInit {
private clearResults() {
this.movieResults = [];
this.searchApplied = false;
}
}

@ -28,6 +28,11 @@
<br />
<!-- TV content -->
<div id="tvList">
<div *ngIf="searchApplied && tvResults?.length <= 0" class='no-search-results'>
<i class='fa fa-film no-search-results-icon'></i><div class='no-search-results-text'>Sorry, we didn't find any results!</div>
</div>
<div *ngFor="let result of tvResults">
<div class="row">
<div class="col-sm-2">
@ -37,11 +42,13 @@
</div>
<div class="col-sm-8">
<div>
<a href="http://www.imdb.com/title/{{result.imdbId}}/" target="_blank">
{{result.seriesName}} ({{result.firstAired}})
<h4>{{result.seriesName}} ({{result.firstAired}})</h4>
</a>
</a><span *ngIf="result.status" class="label label-primary" style="font-size:60%" target="_blank">{{result.status}}</span>
<span *ngIf="result.status" class="label label-primary" style="font-size: 60%" target="_blank">{{result.status}}</span>
<span *ngIf="result.firstAired" class="label label-info" target="_blank">Air Date: {{result.firstAired}}</span>
@ -71,19 +78,19 @@
<br/>
<br/>
</div>
<p style="font-size:0.9rem !important">{{result.overview}}</p>
<p style="font-size: 0.9rem !important">{{result.overview}}</p>
</div>
<div class="col-sm-2">
<input name="{{type}}Id" type="text" value="{{result.id}}" hidden="hidden" />
<input name="{{type}}Id" type="text" value="{{result.id}}" hidden="hidden"/>
<div *ngIf="result.available">
<button style="text-align: right" class="btn btn-success-outline disabled" disabled><i class="fa fa-check"></i> Available</button>
<div *ngIf="result.url">
<br />
<br />
<br/>
<br/>
<a style="text-align: right" class="btn btn-sm btn-primary-outline" href="{{result.url}}" target="_blank"><i class="fa fa-eye"></i> View In Plex</a>
</div>
@ -99,7 +106,7 @@
<!--{{#if_eq type "tv"}}
{{#if_eq tvFullyAvailable true}}
@*//TODO Not used yet*@
<button style="text-align: right" class="btn btn-success-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Available</button><br />
<button style="text-align: right" class="btn btn-success-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Available</button><br/>
{{else}}
{{#if_eq enableTvRequestsForOnlySeries true}}
<button id="{{id}}" style="text-align: right" class="btn {{#if available}}btn-success-outline{{else}}btn-primary-outline dropdownTv{{/if}} btn-primary-outline" season-select="0" type="button" {{#if available}} disabled{{/if}}><i class="fa fa-plus"></i> {{#if available}}@UI.Search_Available{{else}}@UI.Search_Request{{/if}}</button>
@ -124,7 +131,7 @@
{{/if_eq}}
{{#if available}}
{{#if url}}
<br />
<br/>
<a style="text-align: right" class="btn btn-sm btn-primary-outline" href="{{url}}" target="_blank"><i class="fa fa-eye"></i> @UI.Search_ViewInPlex</a>
{{/if}}
{{/if}}
@ -132,10 +139,10 @@
{{/if_eq}}-->
<br />
<br/>
<div *ngIf="result.available">
<input name="providerId" type="text" value="{{id}}" hidden="hidden" />
<input name="type" type="text" value="{{type}}" hidden="hidden" />
<input name="providerId" type="text" value="{{id}}" hidden="hidden"/>
<input name="type" type="text" value="{{type}}" hidden="hidden"/>
<div class="dropdown">
<button class="btn btn-sm btn-danger-outline dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-exclamation"></i> @UI.Search_ReportIssue
@ -154,7 +161,7 @@
</div>
</div>
<hr />
<hr/>
</div>
</div>

@ -22,6 +22,7 @@ export class TvSearchComponent implements OnInit {
searchChanged = new Subject<string>();
tvResults: ISearchTvResult[];
result: IRequestEngineResult;
searchApplied = false;
constructor(private searchService: SearchService, private requestService: RequestService, private notificationService: NotificationService) {
this.searchChanged
@ -35,6 +36,7 @@ export class TvSearchComponent implements OnInit {
}
this.searchService.searchTv(this.searchText).subscribe(x => {
this.tvResults = x;
this.searchApplied = true;
});
});
}
@ -98,6 +100,7 @@ export class TvSearchComponent implements OnInit {
private clearResults() {
this.tvResults = [];
this.searchApplied = false;
}
}
Loading…
Cancel
Save