|
|
|
@ -149,7 +149,16 @@ export class MovieRequestsComponent implements OnInit {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public clearFilter() {
|
|
|
|
|
public clearFilter(el: any) {
|
|
|
|
|
el = el.toElement || el.relatedTarget || el.target || el.srcElement;
|
|
|
|
|
|
|
|
|
|
el = el.parentElement;
|
|
|
|
|
el = el.querySelectorAll("INPUT");
|
|
|
|
|
for (el of el) {
|
|
|
|
|
el.checked = false;
|
|
|
|
|
el.parentElement.classList.remove("active");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.filterDisplay = false;
|
|
|
|
|
this.filter.availabilityFilter = FilterType.None;
|
|
|
|
|
this.filter.statusFilter = FilterType.None;
|
|
|
|
@ -157,7 +166,8 @@ export class MovieRequestsComponent implements OnInit {
|
|
|
|
|
this.resetSearch();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public filterAvailability(filter: FilterType) {
|
|
|
|
|
public filterAvailability(filter: FilterType, el: any) {
|
|
|
|
|
this.filterActiveStyle(el);
|
|
|
|
|
this.filter.availabilityFilter = filter;
|
|
|
|
|
this.requestService.filterMovies(this.filter)
|
|
|
|
|
.subscribe(x => {
|
|
|
|
@ -166,7 +176,8 @@ export class MovieRequestsComponent implements OnInit {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public filterStatus(filter: FilterType) {
|
|
|
|
|
public filterStatus(filter: FilterType, el: any) {
|
|
|
|
|
this.filterActiveStyle(el);
|
|
|
|
|
this.filter.statusFilter = filter;
|
|
|
|
|
this.requestService.filterMovies(this.filter)
|
|
|
|
|
.subscribe(x => {
|
|
|
|
@ -190,6 +201,24 @@ export class MovieRequestsComponent implements OnInit {
|
|
|
|
|
this.order = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private filterActiveStyle(el: any) {
|
|
|
|
|
el = el.toElement || el.relatedTarget || el.target || el.srcElement;
|
|
|
|
|
|
|
|
|
|
el = el.parentElement; //gets radio div
|
|
|
|
|
el = el.parentElement; //gets form group div
|
|
|
|
|
el = el.parentElement; //gets status filter div
|
|
|
|
|
el = el.querySelectorAll("INPUT");
|
|
|
|
|
for (el of el) {
|
|
|
|
|
if (el.checked) {
|
|
|
|
|
if (!el.parentElement.classList.contains("active")) {
|
|
|
|
|
el.parentElement.className += " active";
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
el.parentElement.classList.remove("active");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private loadRequests(amountToLoad: number, currentlyLoaded: number) {
|
|
|
|
|
this.requestService.getMovieRequests(amountToLoad, currentlyLoaded + 1)
|
|
|
|
|
.subscribe(x => {
|
|
|
|
@ -243,7 +272,8 @@ export class MovieRequestsComponent implements OnInit {
|
|
|
|
|
this.movieRequests = x;
|
|
|
|
|
|
|
|
|
|
this.movieRequests.forEach((req) => {
|
|
|
|
|
this.movieRequests.forEach((req) => this.setBackground(req));
|
|
|
|
|
this.setBackground(req);
|
|
|
|
|
this.setPoster(req);
|
|
|
|
|
});
|
|
|
|
|
this.radarrService.getQualityProfilesFromSettings().subscribe(c => {
|
|
|
|
|
this.radarrProfiles = c;
|
|
|
|
@ -296,11 +326,20 @@ export class MovieRequestsComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private setOverride(req: IMovieRequests): void {
|
|
|
|
|
this.setPoster(req);
|
|
|
|
|
this.setBackground(req);
|
|
|
|
|
this.setQualityOverrides(req);
|
|
|
|
|
this.setRootFolderOverrides(req);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private setPoster(req: IMovieRequests): void {
|
|
|
|
|
if (req.posterPath === null) {
|
|
|
|
|
req.posterPath = "../../../images/default_movie_poster.png";
|
|
|
|
|
} else {
|
|
|
|
|
req.posterPath = "https://image.tmdb.org/t/p/w300/" + req.posterPath;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private setBackground(req: IMovieRequests): void {
|
|
|
|
|
req.backgroundPath = this.sanitizer.bypassSecurityTrustStyle
|
|
|
|
|
("url(" + "https://image.tmdb.org/t/p/w1280" + req.background + ")");
|
|
|
|
|