This commit is contained in:
Anojh 2018-05-11 16:12:31 -07:00
parent 3b9454258b
commit 196a33f087
5 changed files with 55 additions and 15 deletions

View file

@ -25,6 +25,7 @@ export class IssueDetailsComponent implements OnInit {
public settings: IIssueSettings; public settings: IIssueSettings;
public backgroundPath: any; public backgroundPath: any;
public posterPath: any; public posterPath: any;
public defaultPoster: string;
private issueId: number; private issueId: number;
@ -42,6 +43,13 @@ export class IssueDetailsComponent implements OnInit {
this.isAdmin = this.authService.hasRole("Admin") || this.authService.hasRole("PowerUser"); this.isAdmin = this.authService.hasRole("Admin") || this.authService.hasRole("PowerUser");
this.settingsService.getIssueSettings().subscribe(x => this.settings = x); 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() { public ngOnInit() {
@ -99,7 +107,7 @@ export class IssueDetailsComponent implements OnInit {
}); });
this.imageService.getMoviePoster(issue.providerId).subscribe(x => { this.imageService.getMoviePoster(issue.providerId).subscribe(x => {
if (x.length === 0) { if (x.length === 0) {
this.posterPath = "../../../images/default_movie_poster.png"; this.posterPath = this.defaultPoster + "default_movie_poster.png";
} else { } else {
this.posterPath = x.toString(); this.posterPath = x.toString();
} }
@ -112,7 +120,7 @@ export class IssueDetailsComponent implements OnInit {
}); });
this.imageService.getTvPoster(Number(issue.providerId)).subscribe(x => { this.imageService.getTvPoster(Number(issue.providerId)).subscribe(x => {
if (x.length === 0) { if (x.length === 0) {
this.posterPath = "../../../images/default_tv_poster.png"; this.posterPath = this.defaultPoster + "default_tv_poster.png";
} else { } else {
this.posterPath = x.toString(); this.posterPath = x.toString();
} }

View file

@ -6,7 +6,7 @@ import "rxjs/add/operator/map";
import { Subject } from "rxjs/Subject"; import { Subject } from "rxjs/Subject";
import { AuthService } from "../auth/auth.service"; 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"; 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 { export class MovieRequestsComponent implements OnInit {
public movieRequests: IMovieRequests[]; public movieRequests: IMovieRequests[];
public defaultPoster: string;
public searchChanged: Subject<string> = new Subject<string>(); public searchChanged: Subject<string> = new Subject<string>();
public searchText: string; public searchText: string;
@ -47,7 +48,8 @@ export class MovieRequestsComponent implements OnInit {
private auth: AuthService, private auth: AuthService,
private notificationService: NotificationService, private notificationService: NotificationService,
private radarrService: RadarrService, private radarrService: RadarrService,
private sanitizer: DomSanitizer) { private sanitizer: DomSanitizer,
private settingsService: SettingsService) {
this.searchChanged this.searchChanged
.debounceTime(600) // Wait Xms after the last event before emitting last event .debounceTime(600) // Wait Xms after the last event before emitting last event
.distinctUntilChanged() // only emit if value is different from previous value .distinctUntilChanged() // only emit if value is different from previous value
@ -63,6 +65,12 @@ export class MovieRequestsComponent implements OnInit {
this.movieRequests = m; 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() { public ngOnInit() {
@ -354,7 +362,7 @@ export class MovieRequestsComponent implements OnInit {
private setPoster(req: IMovieRequests): void { private setPoster(req: IMovieRequests): void {
if (req.posterPath === null) { if (req.posterPath === null) {
req.posterPath = "../../../images/default_movie_poster.png"; req.posterPath = this.defaultPoster;
} else { } else {
req.posterPath = "https://image.tmdb.org/t/p/w300/" + req.posterPath; req.posterPath = "https://image.tmdb.org/t/p/w300/" + req.posterPath;
} }

View file

@ -11,7 +11,7 @@ import "rxjs/add/operator/distinctUntilChanged";
import "rxjs/add/operator/map"; import "rxjs/add/operator/map";
import { AuthService } from "../auth/auth.service"; 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 { TreeNode } from "primeng/primeng";
import { IIssueCategory, IPagenator, ISonarrProfile, ISonarrRootFolder, ITvRequests } from "../interfaces"; import { IIssueCategory, IPagenator, ISonarrProfile, ISonarrRootFolder, ITvRequests } from "../interfaces";
@ -29,6 +29,7 @@ export class TvRequestsComponent implements OnInit {
public isAdmin: boolean; public isAdmin: boolean;
public showChildDialogue = false; // This is for the child modal popup public showChildDialogue = false; // This is for the child modal popup
public selectedSeason: ITvRequests; public selectedSeason: ITvRequests;
public defaultPoster: string;
@Input() public issueCategories: IIssueCategory[]; @Input() public issueCategories: IIssueCategory[];
@Input() public issuesEnabled: boolean; @Input() public issuesEnabled: boolean;
@ -49,7 +50,8 @@ export class TvRequestsComponent implements OnInit {
private sanitizer: DomSanitizer, private sanitizer: DomSanitizer,
private imageService: ImageService, private imageService: ImageService,
private sonarrService: SonarrService, private sonarrService: SonarrService,
private notificationService: NotificationService) { private notificationService: NotificationService,
private settingsService: SettingsService) {
this.searchChanged this.searchChanged
.debounceTime(600) // Wait Xms after the last event before emitting last event .debounceTime(600) // Wait Xms after the last event before emitting last event
.distinctUntilChanged() // only emit if value is different from previous value .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.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) { public openClosestTab(el: any) {
@ -222,7 +230,7 @@ export class TvRequestsComponent implements OnInit {
private setDefaults(val: any) { private setDefaults(val: any) {
if (val.data.posterPath === null) { if (val.data.posterPath === null) {
val.data.posterPath = "../../../images/default_tv_poster.png"; val.data.posterPath = this.defaultPoster;
} }
} }

View file

@ -8,7 +8,7 @@ import { Subject } from "rxjs/Subject";
import { AuthService } from "../auth/auth.service"; import { AuthService } from "../auth/auth.service";
import { IIssueCategory, IRequestEngineResult, ISearchMovieResult } from "../interfaces"; import { IIssueCategory, IRequestEngineResult, ISearchMovieResult } from "../interfaces";
import { NotificationService, RequestService, SearchService } from "../services"; import { NotificationService, RequestService, SearchService, SettingsService } from "../services";
@Component({ @Component({
selector: "movie-search", selector: "movie-search",
@ -29,10 +29,12 @@ export class MovieSearchComponent implements OnInit {
public issueRequestId: number; public issueRequestId: number;
public issueProviderId: string; public issueProviderId: string;
public issueCategorySelected: IIssueCategory; public issueCategorySelected: IIssueCategory;
public defaultPoster: string;
constructor(private searchService: SearchService, private requestService: RequestService, constructor(private searchService: SearchService, private requestService: RequestService,
private notificationService: NotificationService, private authService: AuthService, 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 this.searchChanged
.debounceTime(600) // Wait Xms after the last event before emitting last event .debounceTime(600) // Wait Xms after the last event before emitting last event
@ -52,6 +54,12 @@ export class MovieSearchComponent implements OnInit {
this.getExtraInfo(); 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() { public ngOnInit() {
@ -159,7 +167,7 @@ export class MovieSearchComponent implements OnInit {
this.movieResults.forEach((val, index) => { this.movieResults.forEach((val, index) => {
if (val.posterPath === null) { if (val.posterPath === null) {
val.posterPath = "../../../images/default_movie_poster.png"; val.posterPath = this.defaultPoster;
} else { } else {
val.posterPath = "https://image.tmdb.org/t/p/w300/" + val.posterPath; val.posterPath = "https://image.tmdb.org/t/p/w300/" + val.posterPath;
} }

View file

@ -3,7 +3,7 @@ import { DomSanitizer } from "@angular/platform-browser";
import { Subject } from "rxjs/Subject"; import { Subject } from "rxjs/Subject";
import { AuthService } from "../auth/auth.service"; 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 { TreeNode } from "primeng/primeng";
import { IRequestEngineResult } from "../interfaces"; import { IRequestEngineResult } from "../interfaces";
@ -21,6 +21,7 @@ export class TvSearchComponent implements OnInit {
public tvResults: TreeNode[]; public tvResults: TreeNode[];
public result: IRequestEngineResult; public result: IRequestEngineResult;
public searchApplied = false; public searchApplied = false;
public defaultPoster: string;
@Input() public issueCategories: IIssueCategory[]; @Input() public issueCategories: IIssueCategory[];
@Input() public issuesEnabled: boolean; @Input() public issuesEnabled: boolean;
@ -32,7 +33,8 @@ export class TvSearchComponent implements OnInit {
constructor(private searchService: SearchService, private requestService: RequestService, constructor(private searchService: SearchService, private requestService: RequestService,
private notificationService: NotificationService, private authService: AuthService, private notificationService: NotificationService, private authService: AuthService,
private imageService: ImageService, private sanitizer: DomSanitizer) { private imageService: ImageService, private sanitizer: DomSanitizer,
private settingsService: SettingsService) {
this.searchChanged this.searchChanged
.debounceTime(600) // Wait Xms after the last event before emitting last event .debounceTime(600) // Wait Xms after the last event before emitting last event
@ -50,6 +52,12 @@ export class TvSearchComponent implements OnInit {
this.getExtraInfo(); 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) { public openClosestTab(el: any) {
el.preventDefault(); el.preventDefault();
@ -228,7 +236,7 @@ export class TvSearchComponent implements OnInit {
private setDefaults(x: any) { private setDefaults(x: any) {
if (x.data.banner === null) { if (x.data.banner === null) {
x.data.banner = "../../../images/default_tv_poster.png"; x.data.banner = this.defaultPoster;
} }
if (x.data.imdbId === null) { if (x.data.imdbId === null) {