From 4cb88efc06656434aad34ef8aed1d8235a70b164 Mon Sep 17 00:00:00 2001 From: Jamie Rees Date: Tue, 8 May 2018 14:44:31 +0100 Subject: [PATCH 01/13] Fixed an issue where sometimes the OAuth wouldn't work when loading the login page --- src/Ombi/ClientApp/app/login/login.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ombi/ClientApp/app/login/login.component.html b/src/Ombi/ClientApp/app/login/login.component.html index d87b7121e..bb6afc1dd 100644 --- a/src/Ombi/ClientApp/app/login/login.component.html +++ b/src/Ombi/ClientApp/app/login/login.component.html @@ -2,7 +2,7 @@ you can substitue the span of reauth email for a input with the email and include the remember me checkbox --> -
+
From c90dd3e5268e8159643fb5e676a6f56aece674a2 Mon Sep 17 00:00:00 2001 From: Anojh Date: Tue, 8 May 2018 16:23:48 -0700 Subject: [PATCH 02/13] [LC] - Added classes to root/quality override divs --- src/Ombi/ClientApp/app/requests/movierequests.component.html | 4 ++-- src/Ombi/ClientApp/app/requests/tvrequests.component.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.html b/src/Ombi/ClientApp/app/requests/movierequests.component.html index 2431b5477..e67aeb5e6 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.html +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.html @@ -115,10 +115,10 @@
-
{{ 'Requests.QualityOverride' | translate }} +
{{ 'Requests.QualityOverride' | translate }} {{request.qualityOverrideTitle}}
-
{{ 'Requests.RootFolderOverride' | translate }} +
{{ 'Requests.RootFolderOverride' | translate }} {{request.rootPathOverrideTitle}}
diff --git a/src/Ombi/ClientApp/app/requests/tvrequests.component.html b/src/Ombi/ClientApp/app/requests/tvrequests.component.html index c15166e96..cfe589e23 100644 --- a/src/Ombi/ClientApp/app/requests/tvrequests.component.html +++ b/src/Ombi/ClientApp/app/requests/tvrequests.component.html @@ -52,10 +52,10 @@
Release Date: {{node.data.releaseDate | date}}
-
{{ 'Requests.QualityOverride' | translate }} +
{{ 'Requests.QualityOverride' | translate }} {{node.data.qualityOverrideTitle}}
-
{{ 'Requests.RootFolderOverride' | translate }} +
{{ 'Requests.RootFolderOverride' | translate }} {{node.data.rootPathOverrideTitle}}
From 3e2e7d2fc2d0d03e6286e05a4a0eb80e7cb70ab5 Mon Sep 17 00:00:00 2001 From: Jamie Rees Date: Wed, 9 May 2018 08:17:51 +0100 Subject: [PATCH 03/13] Updated to prevent security vulnerability as noted here: https://github.com/aspnet/Announcements/issues/300 --- src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj | 2 +- src/Ombi.Api.Service/Ombi.Api.Service.csproj | 2 +- src/Ombi.Api/Ombi.Api.csproj | 2 +- src/Ombi.Core.Tests/Ombi.Core.Tests.csproj | 2 +- src/Ombi.Core/Ombi.Core.csproj | 6 +++--- .../Ombi.DependencyInjection.csproj | 4 ++-- src/Ombi.Helpers/Ombi.Helpers.csproj | 4 ++-- src/Ombi.Mapping/Ombi.Mapping.csproj | 2 +- .../Ombi.Notifications.Tests.csproj | 2 +- src/Ombi.Schedule.Tests/Ombi.Schedule.Tests.csproj | 3 +-- src/Ombi.Store/Ombi.Store.csproj | 8 ++++---- src/Ombi.Tests/Ombi.Tests.csproj | 4 ++-- src/Ombi.Updater/Ombi.Updater.csproj | 14 +++++++------- src/Ombi/Ombi.csproj | 8 ++++---- 14 files changed, 31 insertions(+), 32 deletions(-) diff --git a/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj b/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj index 1031ffd4a..d2b605337 100644 --- a/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj +++ b/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/Ombi.Api.Service/Ombi.Api.Service.csproj b/src/Ombi.Api.Service/Ombi.Api.Service.csproj index 8e62012d8..67f37c80d 100644 --- a/src/Ombi.Api.Service/Ombi.Api.Service.csproj +++ b/src/Ombi.Api.Service/Ombi.Api.Service.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Ombi.Api/Ombi.Api.csproj b/src/Ombi.Api/Ombi.Api.csproj index 8379691c5..32fc60bb6 100644 --- a/src/Ombi.Api/Ombi.Api.csproj +++ b/src/Ombi.Api/Ombi.Api.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj b/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj index 2aa71c1e2..d75ba3411 100644 --- a/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj +++ b/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/Ombi.Core/Ombi.Core.csproj b/src/Ombi.Core/Ombi.Core.csproj index de6f5c8fa..2037113bd 100644 --- a/src/Ombi.Core/Ombi.Core.csproj +++ b/src/Ombi.Core/Ombi.Core.csproj @@ -10,10 +10,10 @@ - + - - + + diff --git a/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj b/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj index 75f4385bb..675f6461b 100644 --- a/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj +++ b/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/src/Ombi.Helpers/Ombi.Helpers.csproj b/src/Ombi.Helpers/Ombi.Helpers.csproj index 9bb599c2a..12c6fecc4 100644 --- a/src/Ombi.Helpers/Ombi.Helpers.csproj +++ b/src/Ombi.Helpers/Ombi.Helpers.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/src/Ombi.Mapping/Ombi.Mapping.csproj b/src/Ombi.Mapping/Ombi.Mapping.csproj index 78f39bcd5..b6f602886 100644 --- a/src/Ombi.Mapping/Ombi.Mapping.csproj +++ b/src/Ombi.Mapping/Ombi.Mapping.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Ombi.Notifications.Tests/Ombi.Notifications.Tests.csproj b/src/Ombi.Notifications.Tests/Ombi.Notifications.Tests.csproj index cbbe62277..b350b93f4 100644 --- a/src/Ombi.Notifications.Tests/Ombi.Notifications.Tests.csproj +++ b/src/Ombi.Notifications.Tests/Ombi.Notifications.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Ombi.Schedule.Tests/Ombi.Schedule.Tests.csproj b/src/Ombi.Schedule.Tests/Ombi.Schedule.Tests.csproj index 1805b80f2..bdfbd60e6 100644 --- a/src/Ombi.Schedule.Tests/Ombi.Schedule.Tests.csproj +++ b/src/Ombi.Schedule.Tests/Ombi.Schedule.Tests.csproj @@ -5,8 +5,7 @@ - - + diff --git a/src/Ombi.Store/Ombi.Store.csproj b/src/Ombi.Store/Ombi.Store.csproj index 522a96957..703bbf672 100644 --- a/src/Ombi.Store/Ombi.Store.csproj +++ b/src/Ombi.Store/Ombi.Store.csproj @@ -10,10 +10,10 @@ - - - - + + + + diff --git a/src/Ombi.Tests/Ombi.Tests.csproj b/src/Ombi.Tests/Ombi.Tests.csproj index f3d041122..0880682f2 100644 --- a/src/Ombi.Tests/Ombi.Tests.csproj +++ b/src/Ombi.Tests/Ombi.Tests.csproj @@ -7,12 +7,12 @@ - + - + diff --git a/src/Ombi.Updater/Ombi.Updater.csproj b/src/Ombi.Updater/Ombi.Updater.csproj index a23d8a967..3a55a7040 100644 --- a/src/Ombi.Updater/Ombi.Updater.csproj +++ b/src/Ombi.Updater/Ombi.Updater.csproj @@ -12,14 +12,14 @@ - - - - + + + + - - - + + + diff --git a/src/Ombi/Ombi.csproj b/src/Ombi/Ombi.csproj index 89e432580..8b9e00c45 100644 --- a/src/Ombi/Ombi.csproj +++ b/src/Ombi/Ombi.csproj @@ -67,10 +67,10 @@ - - - - + + + + From 3b9454258b5fa157488be7a3488a08c708d05feb Mon Sep 17 00:00:00 2001 From: Jamie Rees Date: Wed, 9 May 2018 08:20:55 +0100 Subject: [PATCH 04/13] !wip changelog --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1efdccb7..91ef9d69d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] From 196a33f087fca176e4517fa9c49efeb4783ed736 Mon Sep 17 00:00:00 2001 From: Anojh Date: Fri, 11 May 2018 16:12:31 -0700 Subject: [PATCH 05/13] fix #2234 --- .../ClientApp/app/issues/issueDetails.component.ts | 14 +++++++++++--- .../app/requests/movierequests.component.ts | 14 +++++++++++--- .../ClientApp/app/requests/tvrequests.component.ts | 14 +++++++++++--- .../ClientApp/app/search/moviesearch.component.ts | 14 +++++++++++--- .../ClientApp/app/search/tvsearch.component.ts | 14 +++++++++++--- 5 files changed, 55 insertions(+), 15 deletions(-) diff --git a/src/Ombi/ClientApp/app/issues/issueDetails.component.ts b/src/Ombi/ClientApp/app/issues/issueDetails.component.ts index 1072bedbd..641ca1cf4 100644 --- a/src/Ombi/ClientApp/app/issues/issueDetails.component.ts +++ b/src/Ombi/ClientApp/app/issues/issueDetails.component.ts @@ -25,7 +25,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, @@ -42,6 +43,13 @@ export class IssueDetailsComponent implements OnInit { this.isAdmin = this.authService.hasRole("Admin") || this.authService.hasRole("PowerUser"); this.settingsService.getIssueSettings().subscribe(x => this.settings = x); + this.settingsService.getOmbi().subscribe(x => { + if (x.baseUrl) { + this.defaultPoster = "../../.." + x.baseUrl + "/images/"; + } else { + this.defaultPoster = "../../../images/"; + } + }); } public ngOnInit() { @@ -99,7 +107,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 +120,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(); } diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.ts b/src/Ombi/ClientApp/app/requests/movierequests.component.ts index eb53af829..b75339bb1 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.ts +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.ts @@ -6,7 +6,7 @@ import "rxjs/add/operator/map"; import { Subject } from "rxjs/Subject"; import { AuthService } from "../auth/auth.service"; -import { NotificationService, RadarrService, RequestService } from "../services"; +import { NotificationService, RadarrService, RequestService, SettingsService } from "../services"; import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadarrProfile, IRadarrRootFolder } from "../interfaces"; @@ -16,6 +16,7 @@ import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadar }) export class MovieRequestsComponent implements OnInit { public movieRequests: IMovieRequests[]; + public defaultPoster: string; public searchChanged: Subject = new Subject(); public searchText: string; @@ -47,7 +48,8 @@ export class MovieRequestsComponent implements OnInit { private auth: AuthService, private notificationService: NotificationService, private radarrService: RadarrService, - private sanitizer: DomSanitizer) { + private sanitizer: DomSanitizer, + private settingsService: SettingsService) { 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 +65,12 @@ export class MovieRequestsComponent implements OnInit { this.movieRequests = m; }); }); + this.defaultPoster = "../../../images/default_movie_poster.png" + this.settingsService.getOmbi().subscribe(x => { + if (x.baseUrl) { + this.defaultPoster = "../../.." + x.baseUrl + "/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; } diff --git a/src/Ombi/ClientApp/app/requests/tvrequests.component.ts b/src/Ombi/ClientApp/app/requests/tvrequests.component.ts index 4f67ef8cc..a7c010458 100644 --- a/src/Ombi/ClientApp/app/requests/tvrequests.component.ts +++ b/src/Ombi/ClientApp/app/requests/tvrequests.component.ts @@ -11,7 +11,7 @@ import "rxjs/add/operator/distinctUntilChanged"; import "rxjs/add/operator/map"; import { AuthService } from "../auth/auth.service"; -import { NotificationService, RequestService, SonarrService } from "../services"; +import { NotificationService, RequestService, SettingsService, SonarrService } from "../services"; import { TreeNode } from "primeng/primeng"; import { IIssueCategory, IPagenator, ISonarrProfile, ISonarrRootFolder, ITvRequests } from "../interfaces"; @@ -29,6 +29,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 +50,8 @@ export class TvRequestsComponent implements OnInit { private sanitizer: DomSanitizer, private imageService: ImageService, private sonarrService: SonarrService, - private notificationService: NotificationService) { + private notificationService: NotificationService, + private settingsService: SettingsService) { 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 +68,12 @@ export class TvRequestsComponent implements OnInit { this.tvRequests.forEach((val) => this.setOverride(val.data)); }); }); + this.defaultPoster = "../../../images/default_tv_poster.png" + this.settingsService.getOmbi().subscribe(x => { + if (x.baseUrl) { + this.defaultPoster = "../../.." + x.baseUrl + "/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; } } diff --git a/src/Ombi/ClientApp/app/search/moviesearch.component.ts b/src/Ombi/ClientApp/app/search/moviesearch.component.ts index 0abc10474..292eb7bb1 100644 --- a/src/Ombi/ClientApp/app/search/moviesearch.component.ts +++ b/src/Ombi/ClientApp/app/search/moviesearch.component.ts @@ -8,7 +8,7 @@ import { Subject } from "rxjs/Subject"; import { AuthService } from "../auth/auth.service"; import { IIssueCategory, IRequestEngineResult, ISearchMovieResult } from "../interfaces"; -import { NotificationService, RequestService, SearchService } from "../services"; +import { NotificationService, RequestService, SearchService, SettingsService } from "../services"; @Component({ selector: "movie-search", @@ -29,10 +29,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 settingsService: SettingsService) { this.searchChanged .debounceTime(600) // Wait Xms after the last event before emitting last event @@ -52,6 +54,12 @@ export class MovieSearchComponent implements OnInit { this.getExtraInfo(); }); }); + this.defaultPoster = "../../../images/default_movie_poster.png" + this.settingsService.getOmbi().subscribe(x => { + if (x.baseUrl) { + this.defaultPoster = "../../.." + x.baseUrl + "/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; } diff --git a/src/Ombi/ClientApp/app/search/tvsearch.component.ts b/src/Ombi/ClientApp/app/search/tvsearch.component.ts index bb30810e4..770ff483d 100644 --- a/src/Ombi/ClientApp/app/search/tvsearch.component.ts +++ b/src/Ombi/ClientApp/app/search/tvsearch.component.ts @@ -3,7 +3,7 @@ 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, SettingsService } from "../services"; import { TreeNode } from "primeng/primeng"; import { IRequestEngineResult } from "../interfaces"; @@ -21,6 +21,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 +33,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 settingsService: SettingsService) { this.searchChanged .debounceTime(600) // Wait Xms after the last event before emitting last event @@ -50,6 +52,12 @@ export class TvSearchComponent implements OnInit { this.getExtraInfo(); }); }); + this.defaultPoster = "../../../images/default_tv_poster.png" + this.settingsService.getOmbi().subscribe(x => { + if (x.baseUrl) { + this.defaultPoster = "../../.." + x.baseUrl + "/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) { From 07c868711aaca46a18f12c6de917839241339545 Mon Sep 17 00:00:00 2001 From: Anojh Date: Fri, 11 May 2018 16:40:31 -0700 Subject: [PATCH 06/13] !wip - improve #2234 and fix build errors --- .../app/issues/issueDetails.component.ts | 18 ++++++++++-------- .../app/requests/movierequests.component.ts | 16 ++++++++-------- .../app/requests/tvrequests.component.ts | 16 ++++++++-------- .../app/search/moviesearch.component.ts | 18 +++++++++--------- .../ClientApp/app/search/tvsearch.component.ts | 16 ++++++++-------- 5 files changed, 43 insertions(+), 41 deletions(-) diff --git a/src/Ombi/ClientApp/app/issues/issueDetails.component.ts b/src/Ombi/ClientApp/app/issues/issueDetails.component.ts index 641ca1cf4..d9c694933 100644 --- a/src/Ombi/ClientApp/app/issues/issueDetails.component.ts +++ b/src/Ombi/ClientApp/app/issues/issueDetails.component.ts @@ -6,6 +6,7 @@ import { ImageService, IssuesService, NotificationService, SettingsService } fro import { DomSanitizer } from "@angular/platform-browser"; import { IIssues, IIssuesChat, IIssueSettings, INewIssueComments, IssueStatus } from "../interfaces"; +import { PlatformLocation } from "@angular/common"; @Component({ templateUrl: "issueDetails.component.html", @@ -35,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); @@ -43,13 +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); - this.settingsService.getOmbi().subscribe(x => { - if (x.baseUrl) { - this.defaultPoster = "../../.." + x.baseUrl + "/images/"; - } else { - this.defaultPoster = "../../../images/"; - } - }); + + const base = this.platformLocation.getBaseHrefFromDOM(); + if (base) { + this.defaultPoster = "../../.." + base + "/images/"; + } else { + this.defaultPoster = "../../../images/"; + } } public ngOnInit() { diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.ts b/src/Ombi/ClientApp/app/requests/movierequests.component.ts index b75339bb1..35688ec72 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.ts +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.ts @@ -6,9 +6,10 @@ import "rxjs/add/operator/map"; import { Subject } from "rxjs/Subject"; import { AuthService } from "../auth/auth.service"; -import { NotificationService, RadarrService, RequestService, SettingsService } from "../services"; +import { NotificationService, RadarrService, RequestService } from "../services"; import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadarrProfile, IRadarrRootFolder } from "../interfaces"; +import { PlatformLocation } from "@angular/common"; @Component({ selector: "movie-requests", @@ -49,7 +50,7 @@ export class MovieRequestsComponent implements OnInit { private notificationService: NotificationService, private radarrService: RadarrService, private sanitizer: DomSanitizer, - private settingsService: SettingsService) { + 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 @@ -65,12 +66,11 @@ export class MovieRequestsComponent implements OnInit { this.movieRequests = m; }); }); - this.defaultPoster = "../../../images/default_movie_poster.png" - this.settingsService.getOmbi().subscribe(x => { - if (x.baseUrl) { - this.defaultPoster = "../../.." + x.baseUrl + "/images/default_movie_poster.png"; - } - }); + this.defaultPoster = "../../../images/default_movie_poster.png"; + const base = this.platformLocation.getBaseHrefFromDOM(); + if (base) { + this.defaultPoster = "../../.." + base + "/images/default_movie_poster.png"; + } } public ngOnInit() { diff --git a/src/Ombi/ClientApp/app/requests/tvrequests.component.ts b/src/Ombi/ClientApp/app/requests/tvrequests.component.ts index a7c010458..c84be2682 100644 --- a/src/Ombi/ClientApp/app/requests/tvrequests.component.ts +++ b/src/Ombi/ClientApp/app/requests/tvrequests.component.ts @@ -11,10 +11,11 @@ import "rxjs/add/operator/distinctUntilChanged"; import "rxjs/add/operator/map"; import { AuthService } from "../auth/auth.service"; -import { NotificationService, RequestService, SettingsService, SonarrService } from "../services"; +import { NotificationService, RequestService, SonarrService } from "../services"; import { TreeNode } from "primeng/primeng"; import { IIssueCategory, IPagenator, ISonarrProfile, ISonarrRootFolder, ITvRequests } from "../interfaces"; +import { PlatformLocation } from "@angular/common"; @Component({ selector: "tv-requests", @@ -51,7 +52,7 @@ export class TvRequestsComponent implements OnInit { private imageService: ImageService, private sonarrService: SonarrService, private notificationService: NotificationService, - private settingsService: SettingsService) { + 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 @@ -68,12 +69,11 @@ export class TvRequestsComponent implements OnInit { this.tvRequests.forEach((val) => this.setOverride(val.data)); }); }); - this.defaultPoster = "../../../images/default_tv_poster.png" - this.settingsService.getOmbi().subscribe(x => { - if (x.baseUrl) { - this.defaultPoster = "../../.." + x.baseUrl + "/images/default_tv_poster.png"; - } - }); + 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) { diff --git a/src/Ombi/ClientApp/app/search/moviesearch.component.ts b/src/Ombi/ClientApp/app/search/moviesearch.component.ts index 292eb7bb1..41fae6f2f 100644 --- a/src/Ombi/ClientApp/app/search/moviesearch.component.ts +++ b/src/Ombi/ClientApp/app/search/moviesearch.component.ts @@ -8,7 +8,8 @@ import { Subject } from "rxjs/Subject"; import { AuthService } from "../auth/auth.service"; import { IIssueCategory, IRequestEngineResult, ISearchMovieResult } from "../interfaces"; -import { NotificationService, RequestService, SearchService, SettingsService } from "../services"; +import { NotificationService, RequestService, SearchService } from "../services"; +import { PlatformLocation } from "@angular/common"; @Component({ selector: "movie-search", @@ -33,8 +34,8 @@ export class MovieSearchComponent implements OnInit { constructor(private searchService: SearchService, private requestService: RequestService, private notificationService: NotificationService, private authService: AuthService, - private readonly translate: TranslateService, private sanitizer: DomSanitizer, - private settingsService: SettingsService) { + 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 @@ -54,12 +55,11 @@ export class MovieSearchComponent implements OnInit { this.getExtraInfo(); }); }); - this.defaultPoster = "../../../images/default_movie_poster.png" - this.settingsService.getOmbi().subscribe(x => { - if (x.baseUrl) { - this.defaultPoster = "../../.." + x.baseUrl + "/images/default_movie_poster.png"; - } - }); + this.defaultPoster = "../../../images/default_movie_poster.png"; + const base = this.platformLocation.getBaseHrefFromDOM(); + if (base) { + this.defaultPoster = "../../.." + base + "/images/default_movie_poster.png"; + } } public ngOnInit() { diff --git a/src/Ombi/ClientApp/app/search/tvsearch.component.ts b/src/Ombi/ClientApp/app/search/tvsearch.component.ts index 770ff483d..051dc5239 100644 --- a/src/Ombi/ClientApp/app/search/tvsearch.component.ts +++ b/src/Ombi/ClientApp/app/search/tvsearch.component.ts @@ -3,11 +3,12 @@ import { DomSanitizer } from "@angular/platform-browser"; import { Subject } from "rxjs/Subject"; import { AuthService } from "../auth/auth.service"; -import { ImageService, NotificationService, RequestService, SearchService, SettingsService } from "../services"; +import { ImageService, NotificationService, RequestService, SearchService } from "../services"; import { TreeNode } from "primeng/primeng"; import { IRequestEngineResult } from "../interfaces"; import { IIssueCategory, ISearchTvResult, ISeasonsViewModel, ITvRequestViewModel } from "../interfaces"; +import { PlatformLocation } from "@angular/common"; @Component({ selector: "tv-search", @@ -34,7 +35,7 @@ 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 settingsService: SettingsService) { + private readonly platformLocation: PlatformLocation) { this.searchChanged .debounceTime(600) // Wait Xms after the last event before emitting last event @@ -52,12 +53,11 @@ export class TvSearchComponent implements OnInit { this.getExtraInfo(); }); }); - this.defaultPoster = "../../../images/default_tv_poster.png" - this.settingsService.getOmbi().subscribe(x => { - if (x.baseUrl) { - this.defaultPoster = "../../.." + x.baseUrl + "/images/default_tv_poster.png"; - } - }); + 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(); From f8861d47a74bad22fe8c1ce6df6b8b89f5b8bb2a Mon Sep 17 00:00:00 2001 From: Anojh Date: Fri, 11 May 2018 16:56:02 -0700 Subject: [PATCH 07/13] !wip - fix lint errors --- src/Ombi/ClientApp/app/issues/issueDetails.component.ts | 2 +- .../ClientApp/app/requests/movierequests.component.ts | 4 ++-- src/Ombi/ClientApp/app/requests/tvrequests.component.ts | 4 ++-- src/Ombi/ClientApp/app/search/moviesearch.component.ts | 8 ++++---- src/Ombi/ClientApp/app/search/tvsearch.component.ts | 5 +++-- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Ombi/ClientApp/app/issues/issueDetails.component.ts b/src/Ombi/ClientApp/app/issues/issueDetails.component.ts index d9c694933..38adbe390 100644 --- a/src/Ombi/ClientApp/app/issues/issueDetails.component.ts +++ b/src/Ombi/ClientApp/app/issues/issueDetails.component.ts @@ -1,3 +1,4 @@ +import { PlatformLocation } from "@angular/common"; import { Component, OnInit } from "@angular/core"; import { ActivatedRoute } from "@angular/router"; @@ -6,7 +7,6 @@ import { ImageService, IssuesService, NotificationService, SettingsService } fro import { DomSanitizer } from "@angular/platform-browser"; import { IIssues, IIssuesChat, IIssueSettings, INewIssueComments, IssueStatus } from "../interfaces"; -import { PlatformLocation } from "@angular/common"; @Component({ templateUrl: "issueDetails.component.html", diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.ts b/src/Ombi/ClientApp/app/requests/movierequests.component.ts index 35688ec72..b49ef4bde 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.ts +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.ts @@ -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"; @@ -9,7 +10,6 @@ import { AuthService } from "../auth/auth.service"; import { NotificationService, RadarrService, RequestService } from "../services"; import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadarrProfile, IRadarrRootFolder } from "../interfaces"; -import { PlatformLocation } from "@angular/common"; @Component({ selector: "movie-requests", diff --git a/src/Ombi/ClientApp/app/requests/tvrequests.component.ts b/src/Ombi/ClientApp/app/requests/tvrequests.component.ts index c84be2682..10b1b750e 100644 --- a/src/Ombi/ClientApp/app/requests/tvrequests.component.ts +++ b/src/Ombi/ClientApp/app/requests/tvrequests.component.ts @@ -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"; @@ -15,7 +16,6 @@ import { NotificationService, RequestService, SonarrService } from "../services" import { TreeNode } from "primeng/primeng"; import { IIssueCategory, IPagenator, ISonarrProfile, ISonarrRootFolder, ITvRequests } from "../interfaces"; -import { PlatformLocation } from "@angular/common"; @Component({ selector: "tv-requests", diff --git a/src/Ombi/ClientApp/app/search/moviesearch.component.ts b/src/Ombi/ClientApp/app/search/moviesearch.component.ts index 41fae6f2f..c8c7514a7 100644 --- a/src/Ombi/ClientApp/app/search/moviesearch.component.ts +++ b/src/Ombi/ClientApp/app/search/moviesearch.component.ts @@ -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"; @@ -9,7 +10,6 @@ import { Subject } from "rxjs/Subject"; import { AuthService } from "../auth/auth.service"; import { IIssueCategory, IRequestEngineResult, ISearchMovieResult } from "../interfaces"; import { NotificationService, RequestService, SearchService } from "../services"; -import { PlatformLocation } from "@angular/common"; @Component({ selector: "movie-search", @@ -34,8 +34,8 @@ export class MovieSearchComponent implements OnInit { constructor(private searchService: SearchService, private requestService: RequestService, private notificationService: NotificationService, private authService: AuthService, - private readonly translate: TranslateService, private sanitizer: DomSanitizer, - private readonly platformLocation: PlatformLocation) { + 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 diff --git a/src/Ombi/ClientApp/app/search/tvsearch.component.ts b/src/Ombi/ClientApp/app/search/tvsearch.component.ts index 051dc5239..02d833970 100644 --- a/src/Ombi/ClientApp/app/search/tvsearch.component.ts +++ b/src/Ombi/ClientApp/app/search/tvsearch.component.ts @@ -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 { Subject } from "rxjs/Subject"; @@ -8,7 +9,7 @@ import { ImageService, NotificationService, RequestService, SearchService } from import { TreeNode } from "primeng/primeng"; import { IRequestEngineResult } from "../interfaces"; import { IIssueCategory, ISearchTvResult, ISeasonsViewModel, ITvRequestViewModel } from "../interfaces"; -import { PlatformLocation } from "@angular/common"; + @Component({ selector: "tv-search", From 241c2b94d73e6a40784cb3cd7dcf26cc56dd07cb Mon Sep 17 00:00:00 2001 From: Anojh Date: Fri, 11 May 2018 17:02:27 -0700 Subject: [PATCH 08/13] !wip - fix build --- src/Ombi/ClientApp/app/search/tvsearch.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Ombi/ClientApp/app/search/tvsearch.component.ts b/src/Ombi/ClientApp/app/search/tvsearch.component.ts index 02d833970..cdb3e1c6e 100644 --- a/src/Ombi/ClientApp/app/search/tvsearch.component.ts +++ b/src/Ombi/ClientApp/app/search/tvsearch.component.ts @@ -10,7 +10,6 @@ import { TreeNode } from "primeng/primeng"; import { IRequestEngineResult } from "../interfaces"; import { IIssueCategory, ISearchTvResult, ISeasonsViewModel, ITvRequestViewModel } from "../interfaces"; - @Component({ selector: "tv-search", templateUrl: "./tvsearch.component.html", From 573c91d1ea03022997079b57a25be700efafef5b Mon Sep 17 00:00:00 2001 From: Anojh Date: Fri, 11 May 2018 19:11:41 -0700 Subject: [PATCH 09/13] fix #2246 --- .../Templates/NewsletterTemplate.html | 4 ++-- src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html index e9a2b7f29..81190334a 100644 --- a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html +++ b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html @@ -157,12 +157,12 @@ - +
- +
diff --git a/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs b/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs index ed34a6236..651c7287f 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs @@ -306,7 +306,7 @@ namespace Ombi.Schedule.Jobs.Ombi var embyMovies = embyContentToSend.Where(x => x.Type == EmbyMediaType.Movie); if ((plexMovies.Any() || embyMovies.Any()) && !settings.DisableMovies) { - sb.Append("

New Movies



"); + sb.Append("

New Movies



"); sb.Append( ""); sb.Append(""); @@ -324,7 +324,7 @@ namespace Ombi.Schedule.Jobs.Ombi if ((plexEpisodes.Any() || embyEp.Any()) && !settings.DisableTv) { - sb.Append("

New TV



"); + sb.Append("

New TV



"); sb.Append( "
"); sb.Append(""); @@ -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) From 53631e9ac9a11bde27a82a1f74321098abe1a82e Mon Sep 17 00:00:00 2001 From: Anojh Date: Fri, 11 May 2018 20:29:32 -0700 Subject: [PATCH 10/13] Enhanced newsletter styling to support more mail clients --- src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs | 2 +- src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs index 3f9a182a4..a28133bc2 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs @@ -7,7 +7,7 @@ namespace Ombi.Schedule.Jobs.Ombi protected virtual void AddBackgroundInsideTable(StringBuilder sb, string url) { sb.Append("
"); - sb.AppendFormat("", url); + sb.AppendFormat("
", url); sb.Append(""); sb.Append("
"); sb.Append(""); diff --git a/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs b/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs index 651c7287f..3c6a4458f 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs @@ -308,10 +308,10 @@ namespace Ombi.Schedule.Jobs.Ombi { sb.Append("

New Movies



"); sb.Append( - "
"); + "
"); sb.Append(""); sb.Append("
"); - sb.Append(""); + sb.Append("
"); sb.Append(""); await ProcessPlexMovies(plexMovies, sb); await ProcessEmbyMovies(embyMovies, sb); @@ -326,10 +326,10 @@ namespace Ombi.Schedule.Jobs.Ombi { sb.Append("

New TV



"); sb.Append( - "
"); + "
"); sb.Append(""); sb.Append("
"); - sb.Append(""); + sb.Append("
"); sb.Append(""); await ProcessPlexTv(plexEpisodes, sb); await ProcessEmbyTv(embyEp, sb); From bc2b4d150bf971924db0f097240e9a1a6e163e47 Mon Sep 17 00:00:00 2001 From: Anojh Date: Fri, 11 May 2018 20:33:42 -0700 Subject: [PATCH 11/13] Added classes to donation html elements --- src/Ombi/ClientApp/app/app.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi/ClientApp/app/app.component.html b/src/Ombi/ClientApp/app/app.component.html index fcb437fdb..0b397de50 100644 --- a/src/Ombi/ClientApp/app/app.component.html +++ b/src/Ombi/ClientApp/app/app.component.html @@ -55,13 +55,13 @@ -