|
|
@ -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 { DomSanitizer } from "@angular/platform-browser";
|
|
|
|
import "rxjs/add/operator/debounceTime";
|
|
|
|
import "rxjs/add/operator/debounceTime";
|
|
|
|
import "rxjs/add/operator/distinctUntilChanged";
|
|
|
|
import "rxjs/add/operator/distinctUntilChanged";
|
|
|
@ -16,6 +17,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 +49,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 readonly platformLocation: PlatformLocation) {
|
|
|
|
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 +66,11 @@ export class MovieRequestsComponent implements OnInit {
|
|
|
|
this.movieRequests = m;
|
|
|
|
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() {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|