From 196a33f087fca176e4517fa9c49efeb4783ed736 Mon Sep 17 00:00:00 2001 From: Anojh Date: Fri, 11 May 2018 16:12:31 -0700 Subject: [PATCH 01/19] 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 02/19] !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 03/19] !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 04/19] !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 05/19] 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 06/19] 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 07/19] 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 @@ -