|
|
@ -1,9 +1,10 @@
|
|
|
|
import { PlatformLocation } from "@angular/common";
|
|
|
|
import { PlatformLocation } from "@angular/common";
|
|
|
|
import { Component, Input, OnInit } from "@angular/core";
|
|
|
|
import { Component, Input, OnInit, ViewChild } from "@angular/core";
|
|
|
|
import { DomSanitizer } from "@angular/platform-browser";
|
|
|
|
import { DomSanitizer } from "@angular/platform-browser";
|
|
|
|
import { Subject } from "rxjs";
|
|
|
|
import { Subject } from "rxjs";
|
|
|
|
import { debounceTime, distinctUntilChanged } from "rxjs/operators";
|
|
|
|
import { debounceTime, distinctUntilChanged } from "rxjs/operators";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { ConfirmationService, ConfirmDialog } from "primeng/primeng";
|
|
|
|
import { AuthService } from "../auth/auth.service";
|
|
|
|
import { AuthService } from "../auth/auth.service";
|
|
|
|
import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadarrProfile, IRadarrRootFolder, OrderType } from "../interfaces";
|
|
|
|
import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadarrProfile, IRadarrRootFolder, OrderType } from "../interfaces";
|
|
|
|
import { NotificationService, RadarrService, RequestService } from "../services";
|
|
|
|
import { NotificationService, RadarrService, RequestService } from "../services";
|
|
|
@ -37,9 +38,10 @@ export class MovieRequestsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
public orderType: OrderType = OrderType.RequestedDateDesc;
|
|
|
|
public orderType: OrderType = OrderType.RequestedDateDesc;
|
|
|
|
public OrderType = OrderType;
|
|
|
|
public OrderType = OrderType;
|
|
|
|
|
|
|
|
@ViewChild("") public confirmDialogComponent: ConfirmDialog;
|
|
|
|
|
|
|
|
|
|
|
|
public totalMovies: number = 100;
|
|
|
|
public totalMovies: number = 100;
|
|
|
|
private currentlyLoaded: number;
|
|
|
|
public currentlyLoaded: number;
|
|
|
|
private amountToLoad: number;
|
|
|
|
private amountToLoad: number;
|
|
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
constructor(
|
|
|
@ -48,7 +50,8 @@ export class MovieRequestsComponent implements OnInit {
|
|
|
|
private notificationService: NotificationService,
|
|
|
|
private notificationService: NotificationService,
|
|
|
|
private radarrService: RadarrService,
|
|
|
|
private radarrService: RadarrService,
|
|
|
|
private sanitizer: DomSanitizer,
|
|
|
|
private sanitizer: DomSanitizer,
|
|
|
|
private readonly platformLocation: PlatformLocation) {
|
|
|
|
private readonly platformLocation: PlatformLocation,
|
|
|
|
|
|
|
|
private confirmationService: ConfirmationService) {
|
|
|
|
this.searchChanged.pipe(
|
|
|
|
this.searchChanged.pipe(
|
|
|
|
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
|
|
|
@ -130,8 +133,14 @@ export class MovieRequestsComponent implements OnInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public deny(request: IMovieRequests) {
|
|
|
|
public deny(request: IMovieRequests) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.confirmationService.confirm({
|
|
|
|
|
|
|
|
message: "Are you sure",
|
|
|
|
|
|
|
|
accept: () => {
|
|
|
|
request.denied = true;
|
|
|
|
request.denied = true;
|
|
|
|
this.denyRequest(request);
|
|
|
|
this.denyRequest(request);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public selectRootFolder(searchResult: IMovieRequests, rootFolderSelected: IRadarrRootFolder, event: any) {
|
|
|
|
public selectRootFolder(searchResult: IMovieRequests, rootFolderSelected: IRadarrRootFolder, event: any) {
|
|
|
|