Merge branch 'develop' of https://github.com/tidusjar/Ombi into develop

pull/2258/head
Jamie Rees 6 years ago
commit f133e8c2e9

@ -4,6 +4,21 @@
### **New Features**
- Updated to prevent security vulnerability as noted here: https://github.com/aspnet/Announcements/issues/300. [Jamie Rees]
### **Fixes**
- [LC] - Added classes to root/quality override divs. [Anojh]
- Fixed an issue where sometimes the OAuth wouldn't work when loading the login page. [Jamie Rees]
- Alwats enable mobile link. [Jamie]
## v3.0.3293 (2018-05-05)
### **New Features**
- Added a check for long movie descriptions and dealt with accordingly. [Anojh]
- Update jobs.component.html. [D34DC3N73R]

@ -18,6 +18,10 @@ namespace Ombi.Api.Pushover
public async Task<PushoverResponse> PushAsync(string accessToken, string message, string userToken)
{
if (message.Contains("'"))
{
message = message.Replace("'", "&#39;");
}
var request = new Request($"messages.json?token={accessToken}&user={userToken}&message={WebUtility.HtmlEncode(message)}", PushoverEndpoint, HttpMethod.Post);
var result = await _api.Request<PushoverResponse>(request);

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.2" />
</ItemGroup>
<ItemGroup>

@ -11,7 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="2.0.2" />
</ItemGroup>
<ItemGroup>

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Polly" Version="5.8.0" />
<PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" />

@ -9,7 +9,7 @@
<PackageReference Include="Nunit" Version="3.8.1" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.7.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
<packagereference Include="Microsoft.NET.Test.Sdk" Version="15.6.1"></packagereference>
<packagereference Include="Microsoft.NET.Test.Sdk" Version="15.7.0"></packagereference>
</ItemGroup>
<ItemGroup>

@ -71,7 +71,7 @@ namespace Ombi.Core.Helpers
RequestedUserId = userId,
SeasonRequests = new List<SeasonRequests>(),
Title = ShowInfo.name,
SeriesType = ShowInfo.type.Equals("Animation", StringComparison.CurrentCultureIgnoreCase) ? SeriesType.Anime : SeriesType.Standard
SeriesType = ShowInfo.genres.Any( s => s.Equals("Anime", StringComparison.OrdinalIgnoreCase)) ? SeriesType.Anime : SeriesType.Standard
};
return this;

@ -10,10 +10,10 @@
<ItemGroup>
<PackageReference Include="AutoMapper" Version="6.1.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="3.0.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="3.2.0" />
<PackageReference Include="Hangfire" Version="1.6.19" />
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="2.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="2.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Design" Version="1.1.5" />
<PackageReference Include="MiniProfiler.AspNetCore" Version="4.0.0-alpha6-79" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />

@ -9,8 +9,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="2.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="2.0.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" />
</ItemGroup>

@ -10,8 +10,8 @@
<ItemGroup>
<PackageReference Include="EasyCrypto" Version="3.3.2" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="2.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Nito.AsyncEx" Version="5.0.0-pre-05" />
<PackageReference Include="System.Security.Claims" Version="4.3.0" />

@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="AutoMapper" Version="6.1.1" />
<PackageReference Include="AutoMapper.Collection" Version="3.1.2" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="3.0.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="3.2.0" />
</ItemGroup>
<ItemGroup>

@ -157,12 +157,12 @@
<!-- START CENTERED WHITE CONTAINER -->
<span class="preheader" style="color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;">Ombi Recently Added</span>
<table class="main" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; border-radius: 3px;" width="100%">
<table class="main" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-radius: 3px;">
<!-- START MAIN CONTENT AREA -->
<tr>
<td class="wrapper" style="font-family: sans-serif; font-size: 14px; vertical-align: top; box-sizing: border-box; padding: 20px;" valign="top">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" width="100%">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; max-width: 1042px; width: 100%;">
<tr>
<td align="center">
<img src="{@LOGO}" width="400px" text-align="center"/>

@ -8,7 +8,7 @@
<PackageReference Include="Nunit" Version="3.8.1" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.7.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
<packagereference Include="Microsoft.NET.Test.Sdk" Version="15.6.1"></packagereference>
<packagereference Include="Microsoft.NET.Test.Sdk" Version="15.7.0"></packagereference>
<PackageReference Include="Moq" Version="4.7.99" />
</ItemGroup>

@ -5,8 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.2" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.3" />
<PackageReference Include="Moq" Version="4.7.99" />
<PackageReference Include="Nunit" Version="3.10.1" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.8.0" />

@ -7,7 +7,7 @@ namespace Ombi.Schedule.Jobs.Ombi
protected virtual void AddBackgroundInsideTable(StringBuilder sb, string url)
{
sb.Append("<td align=\"center\" valign=\"top\" class=\"media-card\" style=\"font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 12px; vertical-align: top; padding: 3px; width: 502px; min-width: 500px; max-width: 500px; height: 235px; \">");
sb.AppendFormat("<table class=\"card-bg\" style=\"background-image: url({0}); border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #1f1f1f; background-position: center; background-size: cover; background-repeat: no-repeat; background-clip: padding-box; border: 2px solid rgba(255,118,27,.4); \">", url);
sb.AppendFormat("<table class=\"card-bg\" style=\"background-image: url({0}); border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #1f1f1f; background-position: center; background-size: cover; background-repeat: no-repeat; background-clip: padding-box; border: 2px solid rgba(255,118,27,.4); height: 248px; max-height: 500px; \">", url);
sb.Append("<tr>");
sb.Append("<td>");
sb.Append("<table class=\"bg-tint\" style=\"background-color: rgba(0, 0, 0, .6); position: absolute; width: 490px; height: 239px; \">");

@ -306,12 +306,12 @@ namespace Ombi.Schedule.Jobs.Ombi
var embyMovies = embyContentToSend.Where(x => x.Type == EmbyMediaType.Movie);
if ((plexMovies.Any() || embyMovies.Any()) && !settings.DisableMovies)
{
sb.Append("<h1 style=\"text-align: center;\">New Movies</h1><br /><br />");
sb.Append("<h1 style=\"text-align: center; max-width: 1042px;\">New Movies</h1><br /><br />");
sb.Append(
"<table class=\"movies-table\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100 %; \">");
"<table class=\"movies-table\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; \">");
sb.Append("<tr>");
sb.Append("<td style=\"font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 14px; vertical-align: top; \">");
sb.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100 %; \">");
sb.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; \">");
sb.Append("<tr>");
await ProcessPlexMovies(plexMovies, sb);
await ProcessEmbyMovies(embyMovies, sb);
@ -324,12 +324,12 @@ namespace Ombi.Schedule.Jobs.Ombi
if ((plexEpisodes.Any() || embyEp.Any()) && !settings.DisableTv)
{
sb.Append("<br /><br /><h1 style=\"text-align: center;\">New TV</h1><br /><br />");
sb.Append("<br /><br /><h1 style=\"text-align: center; max-width: 1042px;\">New TV</h1><br /><br />");
sb.Append(
"<table class=\"tv-table\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100 %; \">");
"<table class=\"tv-table\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; \">");
sb.Append("<tr>");
sb.Append("<td style=\"font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 14px; vertical-align: top; \">");
sb.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100 %; \">");
sb.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; \">");
sb.Append("<tr>");
await ProcessPlexTv(plexEpisodes, sb);
await ProcessEmbyTv(embyEp, sb);
@ -588,7 +588,6 @@ namespace Ombi.Schedule.Jobs.Ombi
{
AddGenres(sb, $"Genres: {string.Join(", ", info.genres.Select(x => x.ToString()).ToArray())}");
}
count += 1;
}
catch (Exception e)
@ -598,6 +597,7 @@ namespace Ombi.Schedule.Jobs.Ombi
finally
{
EndLoopHtml(sb);
count += 1;
}
if (count == 2)
@ -752,7 +752,6 @@ namespace Ombi.Schedule.Jobs.Ombi
{
AddGenres(sb, $"Genres: {string.Join(", ", info.genres.Select(x => x.ToString()).ToArray())}");
}
count += 1;
}
catch (Exception e)
@ -762,6 +761,7 @@ namespace Ombi.Schedule.Jobs.Ombi
finally
{
EndLoopHtml(sb);
count += 1;
}
if (count == 2)

@ -10,10 +10,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="1.1.9" />
</ItemGroup>

@ -7,12 +7,12 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.0.2" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.0.3" />
<PackageReference Include="Moq" Version="4.7.99" />
<PackageReference Include="Nunit" Version="3.8.1" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.7.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
<packagereference Include="Microsoft.NET.Test.Sdk" Version="15.6.1"></packagereference>
<packagereference Include="Microsoft.NET.Test.Sdk" Version="15.7.0"></packagereference>
</ItemGroup>
<ItemGroup>

@ -12,14 +12,14 @@
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.1.1-beta" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="2.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.0.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.2" />
<PackageReference Include="Serilog" Version="2.6.0-dev-00892" />
<PackageReference Include="Serilog.Extensions.Logging" Version="2.0.2" />
<PackageReference Include="Serilog.Sinks.File" Version="3.2.0" />

@ -55,13 +55,13 @@
</li>
</ul>
<ul *ngIf="hasRole('Admin') || hasRole('PowerUser')" class="nav navbar-nav">
<ul *ngIf="hasRole('Admin') || hasRole('PowerUser')" class="nav navbar-nav donation">
<li>
<a href="https://www.paypal.me/PlexRequestsNet" target="_blank" pTooltip="{{ 'NavigationBar.DonateTooltip' | translate }}">
<i class="fa fa-heart" style="color:red"></i> {{ 'NavigationBar.Donate' | translate }}</a>
</li>
</ul>
<div *ngIf="customizationSettings">
<div *ngIf="customizationSettings" class="custom-donation">
<ul *ngIf="customizationSettings.enableCustomDonations" class="nav navbar-nav">
<li>
<a href="{{customizationSettings.customDonationUrl}}" target="_blank">

@ -1,3 +1,4 @@
import { PlatformLocation } from "@angular/common";
import { Component, OnInit } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
@ -25,7 +26,8 @@ export class IssueDetailsComponent implements OnInit {
public settings: IIssueSettings;
public backgroundPath: any;
public posterPath: any;
public defaultPoster: string;
private issueId: number;
constructor(private issueService: IssuesService,
@ -34,7 +36,8 @@ export class IssueDetailsComponent implements OnInit {
private settingsService: SettingsService,
private notificationService: NotificationService,
private imageService: ImageService,
private sanitizer: DomSanitizer) {
private sanitizer: DomSanitizer,
private readonly platformLocation: PlatformLocation) {
this.route.params
.subscribe((params: any) => {
this.issueId = parseInt(params.id);
@ -42,6 +45,13 @@ export class IssueDetailsComponent implements OnInit {
this.isAdmin = this.authService.hasRole("Admin") || this.authService.hasRole("PowerUser");
this.settingsService.getIssueSettings().subscribe(x => this.settings = x);
const base = this.platformLocation.getBaseHrefFromDOM();
if (base) {
this.defaultPoster = "../../.." + base + "/images/";
} else {
this.defaultPoster = "../../../images/";
}
}
public ngOnInit() {
@ -99,7 +109,7 @@ export class IssueDetailsComponent implements OnInit {
});
this.imageService.getMoviePoster(issue.providerId).subscribe(x => {
if (x.length === 0) {
this.posterPath = "../../../images/default_movie_poster.png";
this.posterPath = this.defaultPoster + "default_movie_poster.png";
} else {
this.posterPath = x.toString();
}
@ -112,7 +122,7 @@ export class IssueDetailsComponent implements OnInit {
});
this.imageService.getTvPoster(Number(issue.providerId)).subscribe(x => {
if (x.length === 0) {
this.posterPath = "../../../images/default_tv_poster.png";
this.posterPath = this.defaultPoster + "default_tv_poster.png";
} else {
this.posterPath = x.toString();
}

@ -115,10 +115,10 @@
<br />
</div>
<div *ngIf="isAdmin">
<div *ngIf="request.qualityOverrideTitle">{{ 'Requests.QualityOverride' | translate }}
<div *ngIf="request.qualityOverrideTitle" class="quality-override">{{ 'Requests.QualityOverride' | translate }}
<span>{{request.qualityOverrideTitle}} </span>
</div>
<div *ngIf="request.rootPathOverrideTitle">{{ 'Requests.RootFolderOverride' | translate }}
<div *ngIf="request.rootPathOverrideTitle" class="root-override">{{ 'Requests.RootFolderOverride' | translate }}
<span>{{request.rootPathOverrideTitle}} </span>
</div>
</div>

@ -1,4 +1,5 @@
import { Component, Input, OnInit } from "@angular/core";
import { PlatformLocation } from "@angular/common";
import { Component, Input, OnInit } from "@angular/core";
import { DomSanitizer } from "@angular/platform-browser";
import "rxjs/add/operator/debounceTime";
import "rxjs/add/operator/distinctUntilChanged";
@ -16,6 +17,7 @@ import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadar
})
export class MovieRequestsComponent implements OnInit {
public movieRequests: IMovieRequests[];
public defaultPoster: string;
public searchChanged: Subject<string> = new Subject<string>();
public searchText: string;
@ -47,7 +49,8 @@ export class MovieRequestsComponent implements OnInit {
private auth: AuthService,
private notificationService: NotificationService,
private radarrService: RadarrService,
private sanitizer: DomSanitizer) {
private sanitizer: DomSanitizer,
private readonly platformLocation: PlatformLocation) {
this.searchChanged
.debounceTime(600) // Wait Xms after the last event before emitting last event
.distinctUntilChanged() // only emit if value is different from previous value
@ -63,6 +66,11 @@ export class MovieRequestsComponent implements OnInit {
this.movieRequests = m;
});
});
this.defaultPoster = "../../../images/default_movie_poster.png";
const base = this.platformLocation.getBaseHrefFromDOM();
if (base) {
this.defaultPoster = "../../.." + base + "/images/default_movie_poster.png";
}
}
public ngOnInit() {
@ -354,7 +362,7 @@ export class MovieRequestsComponent implements OnInit {
private setPoster(req: IMovieRequests): void {
if (req.posterPath === null) {
req.posterPath = "../../../images/default_movie_poster.png";
req.posterPath = this.defaultPoster;
} else {
req.posterPath = "https://image.tmdb.org/t/p/w300/" + req.posterPath;
}

@ -52,10 +52,10 @@
<div>Release Date: {{node.data.releaseDate | date}}</div>
<div *ngIf="isAdmin">
<div *ngIf="node.data.qualityOverrideTitle">{{ 'Requests.QualityOverride' | translate }}
<div *ngIf="node.data.qualityOverrideTitle" class="quality-override">{{ 'Requests.QualityOverride' | translate }}
<span>{{node.data.qualityOverrideTitle}} </span>
</div>
<div *ngIf="node.data.rootPathOverrideTitle">{{ 'Requests.RootFolderOverride' | translate }}
<div *ngIf="node.data.rootPathOverrideTitle" class="root-override">{{ 'Requests.RootFolderOverride' | translate }}
<span>{{node.data.rootPathOverrideTitle}} </span>
</div>
</div>

@ -1,4 +1,5 @@
import { Component, Input, OnInit } from "@angular/core";
import { PlatformLocation } from "@angular/common";
import { Component, Input, OnInit } from "@angular/core";
import { DomSanitizer } from "@angular/platform-browser";
import "rxjs/add/operator/debounceTime";
import "rxjs/add/operator/distinctUntilChanged";
@ -29,6 +30,7 @@ export class TvRequestsComponent implements OnInit {
public isAdmin: boolean;
public showChildDialogue = false; // This is for the child modal popup
public selectedSeason: ITvRequests;
public defaultPoster: string;
@Input() public issueCategories: IIssueCategory[];
@Input() public issuesEnabled: boolean;
@ -49,7 +51,8 @@ export class TvRequestsComponent implements OnInit {
private sanitizer: DomSanitizer,
private imageService: ImageService,
private sonarrService: SonarrService,
private notificationService: NotificationService) {
private notificationService: NotificationService,
private readonly platformLocation: PlatformLocation) {
this.searchChanged
.debounceTime(600) // Wait Xms after the last event before emitting last event
.distinctUntilChanged() // only emit if value is different from previous value
@ -66,6 +69,11 @@ export class TvRequestsComponent implements OnInit {
this.tvRequests.forEach((val) => this.setOverride(val.data));
});
});
this.defaultPoster = "../../../images/default_tv_poster.png";
const base = this.platformLocation.getBaseHrefFromDOM();
if (base) {
this.defaultPoster = "../../.." + base + "/images/default_tv_poster.png";
}
}
public openClosestTab(el: any) {
@ -222,7 +230,7 @@ export class TvRequestsComponent implements OnInit {
private setDefaults(val: any) {
if (val.data.posterPath === null) {
val.data.posterPath = "../../../images/default_tv_poster.png";
val.data.posterPath = this.defaultPoster;
}
}

@ -1,4 +1,5 @@
import { Component, Input, OnInit } from "@angular/core";
import { PlatformLocation } from "@angular/common";
import { Component, Input, OnInit } from "@angular/core";
import { DomSanitizer } from "@angular/platform-browser";
import { TranslateService } from "@ngx-translate/core";
import "rxjs/add/operator/debounceTime";
@ -29,10 +30,12 @@ export class MovieSearchComponent implements OnInit {
public issueRequestId: number;
public issueProviderId: string;
public issueCategorySelected: IIssueCategory;
public defaultPoster: string;
constructor(private searchService: SearchService, private requestService: RequestService,
private notificationService: NotificationService, private authService: AuthService,
private readonly translate: TranslateService, private sanitizer: DomSanitizer) {
private readonly translate: TranslateService, private sanitizer: DomSanitizer,
private readonly platformLocation: PlatformLocation) {
this.searchChanged
.debounceTime(600) // Wait Xms after the last event before emitting last event
@ -52,6 +55,11 @@ export class MovieSearchComponent implements OnInit {
this.getExtraInfo();
});
});
this.defaultPoster = "../../../images/default_movie_poster.png";
const base = this.platformLocation.getBaseHrefFromDOM();
if (base) {
this.defaultPoster = "../../.." + base + "/images/default_movie_poster.png";
}
}
public ngOnInit() {
@ -159,7 +167,7 @@ export class MovieSearchComponent implements OnInit {
this.movieResults.forEach((val, index) => {
if (val.posterPath === null) {
val.posterPath = "../../../images/default_movie_poster.png";
val.posterPath = this.defaultPoster;
} else {
val.posterPath = "https://image.tmdb.org/t/p/w300/" + val.posterPath;
}

@ -1,9 +1,10 @@
import { Component, Input, OnInit } from "@angular/core";
import { PlatformLocation } from "@angular/common";
import { Component, Input, OnInit } from "@angular/core";
import { DomSanitizer } from "@angular/platform-browser";
import { Subject } from "rxjs/Subject";
import { AuthService } from "../auth/auth.service";
import { ImageService, NotificationService, RequestService, SearchService} from "../services";
import { ImageService, NotificationService, RequestService, SearchService } from "../services";
import { TreeNode } from "primeng/primeng";
import { IRequestEngineResult } from "../interfaces";
@ -21,6 +22,7 @@ export class TvSearchComponent implements OnInit {
public tvResults: TreeNode[];
public result: IRequestEngineResult;
public searchApplied = false;
public defaultPoster: string;
@Input() public issueCategories: IIssueCategory[];
@Input() public issuesEnabled: boolean;
@ -32,7 +34,8 @@ export class TvSearchComponent implements OnInit {
constructor(private searchService: SearchService, private requestService: RequestService,
private notificationService: NotificationService, private authService: AuthService,
private imageService: ImageService, private sanitizer: DomSanitizer) {
private imageService: ImageService, private sanitizer: DomSanitizer,
private readonly platformLocation: PlatformLocation) {
this.searchChanged
.debounceTime(600) // Wait Xms after the last event before emitting last event
@ -50,6 +53,11 @@ export class TvSearchComponent implements OnInit {
this.getExtraInfo();
});
});
this.defaultPoster = "../../../images/default_tv_poster.png";
const base = this.platformLocation.getBaseHrefFromDOM();
if(base) {
this.defaultPoster = "../../.." + base + "/images/default_tv_poster.png";
}
}
public openClosestTab(el: any) {
el.preventDefault();
@ -228,7 +236,7 @@ export class TvSearchComponent implements OnInit {
private setDefaults(x: any) {
if (x.data.banner === null) {
x.data.banner = "../../../images/default_tv_poster.png";
x.data.banner = this.defaultPoster;
}
if (x.data.imdbId === null) {

@ -67,10 +67,10 @@
<PackageReference Include="Hangfire.RecurringJobExtensions" Version="1.1.6" />
<PackageReference Include="Hangfire.SQLite" Version="1.4.2" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.0.2" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="2.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.2" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.0.3" />
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.0.0-alpha6-79" />
<PackageReference Include="ncrontab" Version="3.3.0" />
<PackageReference Include="Serilog" Version="2.6.0-dev-00892" />

Loading…
Cancel
Save