|
|
@ -1,27 +1,27 @@
|
|
|
|
import { Component, OnInit, ViewEncapsulation } from "@angular/core";
|
|
|
|
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
|
|
|
import { ImageService, SearchV2Service, RequestService, MessageService, RadarrService, SettingsStateService } from "../../../services";
|
|
|
|
import { ImageService, SearchV2Service, RequestService, MessageService, RadarrService, SettingsStateService } from '../../../services';
|
|
|
|
import { ActivatedRoute, Router } from "@angular/router";
|
|
|
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
|
|
import { DomSanitizer } from "@angular/platform-browser";
|
|
|
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
|
|
import { ICrewViewModel, ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2";
|
|
|
|
import { ICrewViewModel, ISearchMovieResultV2 } from '../../../interfaces/ISearchMovieResultV2';
|
|
|
|
import { MatDialog } from "@angular/material/dialog";
|
|
|
|
import { MatDialog } from '@angular/material/dialog';
|
|
|
|
import { YoutubeTrailerComponent } from "../shared/youtube-trailer.component";
|
|
|
|
import { YoutubeTrailerComponent } from '../shared/youtube-trailer.component';
|
|
|
|
import { AuthService } from "../../../auth/auth.service";
|
|
|
|
import { AuthService } from '../../../auth/auth.service';
|
|
|
|
import { IMovieRequests, RequestType, IAdvancedData } from "../../../interfaces";
|
|
|
|
import { IMovieRequests, RequestType, IAdvancedData } from '../../../interfaces';
|
|
|
|
import { DenyDialogComponent } from "../shared/deny-dialog/deny-dialog.component";
|
|
|
|
import { DenyDialogComponent } from '../shared/deny-dialog/deny-dialog.component';
|
|
|
|
import { NewIssueComponent } from "../shared/new-issue/new-issue.component";
|
|
|
|
import { NewIssueComponent } from '../shared/new-issue/new-issue.component';
|
|
|
|
import { TranslateService } from "@ngx-translate/core";
|
|
|
|
import { TranslateService } from '@ngx-translate/core';
|
|
|
|
import { MovieAdvancedOptionsComponent } from "./panels/movie-advanced-options/movie-advanced-options.component";
|
|
|
|
import { MovieAdvancedOptionsComponent } from './panels/movie-advanced-options/movie-advanced-options.component';
|
|
|
|
import { RequestServiceV2 } from "../../../services/requestV2.service";
|
|
|
|
import { RequestServiceV2 } from '../../../services/requestV2.service';
|
|
|
|
import { firstValueFrom, forkJoin } from "rxjs";
|
|
|
|
import { firstValueFrom, forkJoin } from 'rxjs';
|
|
|
|
import { AdminRequestDialogComponent } from "../../../shared/admin-request-dialog/admin-request-dialog.component";
|
|
|
|
import { AdminRequestDialogComponent } from '../../../shared/admin-request-dialog/admin-request-dialog.component';
|
|
|
|
import { FeaturesFacade } from "../../../state/features/features.facade";
|
|
|
|
import { FeaturesFacade } from '../../../state/features/features.facade';
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
@Component({
|
|
|
|
templateUrl: "./movie-details.component.html",
|
|
|
|
templateUrl: './movie-details.component.html',
|
|
|
|
styleUrls: ["../../media-details.component.scss"],
|
|
|
|
styleUrls: ['../../media-details.component.scss'],
|
|
|
|
encapsulation: ViewEncapsulation.None
|
|
|
|
encapsulation: ViewEncapsulation.None,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
export class MovieDetailsComponent implements OnInit{
|
|
|
|
export class MovieDetailsComponent implements OnInit {
|
|
|
|
public movie: ISearchMovieResultV2;
|
|
|
|
public movie: ISearchMovieResultV2;
|
|
|
|
public hasRequest: boolean;
|
|
|
|
public hasRequest: boolean;
|
|
|
|
public movieRequest: IMovieRequests;
|
|
|
|
public movieRequest: IMovieRequests;
|
|
|
@ -29,35 +29,44 @@ export class MovieDetailsComponent implements OnInit{
|
|
|
|
public advancedOptions: IAdvancedData;
|
|
|
|
public advancedOptions: IAdvancedData;
|
|
|
|
public showAdvanced: boolean; // Set on the UI
|
|
|
|
public showAdvanced: boolean; // Set on the UI
|
|
|
|
public issuesEnabled: boolean;
|
|
|
|
public issuesEnabled: boolean;
|
|
|
|
public roleName4k = "Request4KMovie";
|
|
|
|
public roleName4k = 'Request4KMovie';
|
|
|
|
public is4KEnabled = false;
|
|
|
|
public is4KEnabled = false;
|
|
|
|
public requestType = RequestType.movie;
|
|
|
|
public requestType = RequestType.movie;
|
|
|
|
private theMovidDbId: number;
|
|
|
|
private theMovidDbId: number;
|
|
|
|
private imdbId: string;
|
|
|
|
private imdbId: string;
|
|
|
|
private snapMovieId: string;
|
|
|
|
private snapMovieId: string;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
constructor(private searchService: SearchV2Service, private route: ActivatedRoute, private router: Router,
|
|
|
|
private searchService: SearchV2Service,
|
|
|
|
private sanitizer: DomSanitizer, private imageService: ImageService,
|
|
|
|
private route: ActivatedRoute,
|
|
|
|
public dialog: MatDialog, private requestService: RequestService,
|
|
|
|
private router: Router,
|
|
|
|
private requestService2: RequestServiceV2, private radarrService: RadarrService,
|
|
|
|
private sanitizer: DomSanitizer,
|
|
|
|
public messageService: MessageService, private auth: AuthService, private settingsState: SettingsStateService,
|
|
|
|
private imageService: ImageService,
|
|
|
|
private translate: TranslateService, private featureFacade: FeaturesFacade) {
|
|
|
|
public dialog: MatDialog,
|
|
|
|
|
|
|
|
private requestService: RequestService,
|
|
|
|
|
|
|
|
private requestService2: RequestServiceV2,
|
|
|
|
|
|
|
|
private radarrService: RadarrService,
|
|
|
|
|
|
|
|
public messageService: MessageService,
|
|
|
|
|
|
|
|
private auth: AuthService,
|
|
|
|
|
|
|
|
private settingsState: SettingsStateService,
|
|
|
|
|
|
|
|
private translate: TranslateService,
|
|
|
|
|
|
|
|
private featureFacade: FeaturesFacade,
|
|
|
|
|
|
|
|
) {
|
|
|
|
this.snapMovieId = this.route.snapshot.params.movieDbId;
|
|
|
|
this.snapMovieId = this.route.snapshot.params.movieDbId;
|
|
|
|
this.route.params.subscribe(async (params: any) => {
|
|
|
|
this.route.params.subscribe(async (params: any) => {
|
|
|
|
if (typeof params.movieDbId === 'string' || params.movieDbId instanceof String) {
|
|
|
|
if (typeof params.movieDbId === 'string' || params.movieDbId instanceof String) {
|
|
|
|
if (params.movieDbId.startsWith("tt")) {
|
|
|
|
if (params.movieDbId.startsWith('tt')) {
|
|
|
|
this.imdbId = params.movieDbId;
|
|
|
|
this.imdbId = params.movieDbId;
|
|
|
|
// Check if we user navigated to another movie and if so reload the component
|
|
|
|
// Check if we user navigated to another movie and if so reload the component
|
|
|
|
if (this.imdbId !== this.snapMovieId) {
|
|
|
|
if (this.imdbId !== this.snapMovieId) {
|
|
|
|
this.reloadComponent()
|
|
|
|
this.reloadComponent();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.theMovidDbId = params.movieDbId;
|
|
|
|
this.theMovidDbId = params.movieDbId;
|
|
|
|
// Check if we user navigated to another movie and if so reload the component
|
|
|
|
// Check if we user navigated to another movie and if so reload the component
|
|
|
|
if (params.movieDbId !== this.snapMovieId) {
|
|
|
|
if (params.movieDbId !== this.snapMovieId) {
|
|
|
|
this.reloadComponent()
|
|
|
|
this.reloadComponent();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -72,14 +81,14 @@ export class MovieDetailsComponent implements OnInit{
|
|
|
|
async ngOnInit() {
|
|
|
|
async ngOnInit() {
|
|
|
|
this.is4KEnabled = this.featureFacade.is4kEnabled();
|
|
|
|
this.is4KEnabled = this.featureFacade.is4kEnabled();
|
|
|
|
this.issuesEnabled = this.settingsState.getIssue();
|
|
|
|
this.issuesEnabled = this.settingsState.getIssue();
|
|
|
|
this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser");
|
|
|
|
this.isAdmin = this.auth.hasRole('admin') || this.auth.hasRole('poweruser');
|
|
|
|
|
|
|
|
|
|
|
|
if (this.isAdmin) {
|
|
|
|
if (this.isAdmin) {
|
|
|
|
this.showAdvanced = await firstValueFrom(this.radarrService.isRadarrEnabled());
|
|
|
|
this.showAdvanced = await firstValueFrom(this.radarrService.isRadarrEnabled());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (this.imdbId) {
|
|
|
|
if (this.imdbId) {
|
|
|
|
this.searchService.getMovieByImdbId(this.imdbId).subscribe(async x => {
|
|
|
|
this.searchService.getMovieByImdbId(this.imdbId).subscribe(async (x) => {
|
|
|
|
this.movie = x;
|
|
|
|
this.movie = x;
|
|
|
|
this.checkPoster();
|
|
|
|
this.checkPoster();
|
|
|
|
this.movie.credits.crew = this.orderCrew(this.movie.credits.crew);
|
|
|
|
this.movie.credits.crew = this.orderCrew(this.movie.credits.crew);
|
|
|
@ -91,7 +100,7 @@ export class MovieDetailsComponent implements OnInit{
|
|
|
|
this.loadBanner();
|
|
|
|
this.loadBanner();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.searchService.getFullMovieDetails(this.theMovidDbId).subscribe(async x => {
|
|
|
|
this.searchService.getFullMovieDetails(this.theMovidDbId).subscribe(async (x) => {
|
|
|
|
this.movie = x;
|
|
|
|
this.movie = x;
|
|
|
|
this.checkPoster();
|
|
|
|
this.checkPoster();
|
|
|
|
this.movie.credits.crew = this.orderCrew(this.movie.credits.crew);
|
|
|
|
this.movie.credits.crew = this.orderCrew(this.movie.credits.crew);
|
|
|
@ -111,15 +120,23 @@ export class MovieDetailsComponent implements OnInit{
|
|
|
|
is4K = false;
|
|
|
|
is4K = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.isAdmin) {
|
|
|
|
if (this.isAdmin) {
|
|
|
|
const dialog = this.dialog.open(AdminRequestDialogComponent, { width: "700px", data: { type: RequestType.movie, id: this.movie.id, is4K: is4K }, panelClass: 'modal-panel' });
|
|
|
|
const dialog = this.dialog.open(AdminRequestDialogComponent, {
|
|
|
|
|
|
|
|
width: '700px',
|
|
|
|
|
|
|
|
data: { type: RequestType.movie, id: this.movie.id, is4K: is4K },
|
|
|
|
|
|
|
|
panelClass: 'modal-panel',
|
|
|
|
|
|
|
|
});
|
|
|
|
dialog.afterClosed().subscribe(async (result) => {
|
|
|
|
dialog.afterClosed().subscribe(async (result) => {
|
|
|
|
if (result) {
|
|
|
|
if (result) {
|
|
|
|
const requestResult = await firstValueFrom(this.requestService.requestMovie({ theMovieDbId: this.theMovidDbId,
|
|
|
|
const requestResult = await firstValueFrom(
|
|
|
|
|
|
|
|
this.requestService.requestMovie({
|
|
|
|
|
|
|
|
theMovieDbId: this.theMovidDbId,
|
|
|
|
languageCode: this.translate.currentLang,
|
|
|
|
languageCode: this.translate.currentLang,
|
|
|
|
qualityPathOverride: result.radarrPathId,
|
|
|
|
qualityPathOverride: result.radarrPathId,
|
|
|
|
requestOnBehalf: result.username?.id,
|
|
|
|
requestOnBehalf: result.username?.id,
|
|
|
|
rootFolderOverride: result.radarrFolderId,
|
|
|
|
rootFolderOverride: result.radarrFolderId,
|
|
|
|
is4KRequest: is4K }));
|
|
|
|
is4KRequest: is4K,
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
);
|
|
|
|
if (requestResult.result) {
|
|
|
|
if (requestResult.result) {
|
|
|
|
if (is4K) {
|
|
|
|
if (is4K) {
|
|
|
|
this.movie.has4KRequest = true;
|
|
|
|
this.movie.has4KRequest = true;
|
|
|
@ -127,7 +144,7 @@ export class MovieDetailsComponent implements OnInit{
|
|
|
|
this.movie.requested = true;
|
|
|
|
this.movie.requested = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.movie.requestId = requestResult.requestId;
|
|
|
|
this.movie.requestId = requestResult.requestId;
|
|
|
|
this.messageService.send(this.translate.instant("Requests.RequestAddedSuccessfully", { title: this.movie.title }), "Ok");
|
|
|
|
this.messageService.send(this.translate.instant('Requests.RequestAddedSuccessfully', { title: this.movie.title }), 'Ok');
|
|
|
|
this.movieRequest = await this.requestService.getMovieRequest(this.movie.requestId);
|
|
|
|
this.movieRequest = await this.requestService.getMovieRequest(this.movie.requestId);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.messageService.sendRequestEngineResultError(requestResult);
|
|
|
|
this.messageService.sendRequestEngineResultError(requestResult);
|
|
|
@ -135,7 +152,16 @@ export class MovieDetailsComponent implements OnInit{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
const result = await firstValueFrom(this.requestService.requestMovie({ theMovieDbId: this.theMovidDbId, languageCode: this.translate.currentLang, requestOnBehalf: userId, qualityPathOverride: undefined, rootFolderOverride: undefined, is4KRequest: is4K }));
|
|
|
|
const result = await firstValueFrom(
|
|
|
|
|
|
|
|
this.requestService.requestMovie({
|
|
|
|
|
|
|
|
theMovieDbId: this.theMovidDbId,
|
|
|
|
|
|
|
|
languageCode: this.translate.currentLang,
|
|
|
|
|
|
|
|
requestOnBehalf: userId,
|
|
|
|
|
|
|
|
qualityPathOverride: undefined,
|
|
|
|
|
|
|
|
rootFolderOverride: undefined,
|
|
|
|
|
|
|
|
is4KRequest: is4K,
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
);
|
|
|
|
if (result.result) {
|
|
|
|
if (result.result) {
|
|
|
|
if (is4K) {
|
|
|
|
if (is4K) {
|
|
|
|
this.movie.has4KRequest = true;
|
|
|
|
this.movie.has4KRequest = true;
|
|
|
@ -144,7 +170,7 @@ export class MovieDetailsComponent implements OnInit{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.movie.requestId = result.requestId;
|
|
|
|
this.movie.requestId = result.requestId;
|
|
|
|
this.movieRequest = await this.requestService.getMovieRequest(this.movie.requestId);
|
|
|
|
this.movieRequest = await this.requestService.getMovieRequest(this.movie.requestId);
|
|
|
|
this.messageService.send(this.translate.instant("Requests.RequestAddedSuccessfully", { title: this.movie.title }), "Ok");
|
|
|
|
this.messageService.send(this.translate.instant('Requests.RequestAddedSuccessfully', { title: this.movie.title }), 'Ok');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.messageService.sendRequestEngineResultError(result);
|
|
|
|
this.messageService.sendRequestEngineResultError(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -154,17 +180,17 @@ export class MovieDetailsComponent implements OnInit{
|
|
|
|
public openDialog() {
|
|
|
|
public openDialog() {
|
|
|
|
this.dialog.open(YoutubeTrailerComponent, {
|
|
|
|
this.dialog.open(YoutubeTrailerComponent, {
|
|
|
|
width: '560px',
|
|
|
|
width: '560px',
|
|
|
|
data: this.movie.videos.results[0].key
|
|
|
|
data: this.movie.videos.results[0].key,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async deny() {
|
|
|
|
public async deny() {
|
|
|
|
const dialogRef = this.dialog.open(DenyDialogComponent, {
|
|
|
|
const dialogRef = this.dialog.open(DenyDialogComponent, {
|
|
|
|
width: '250px',
|
|
|
|
width: '250px',
|
|
|
|
data: { requestId: this.movieRequest.id, requestType: RequestType.movie }
|
|
|
|
data: { requestId: this.movieRequest.id, requestType: RequestType.movie },
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
dialogRef.afterClosed().subscribe(result => {
|
|
|
|
dialogRef.afterClosed().subscribe((result) => {
|
|
|
|
this.movieRequest.denied = result.denied;
|
|
|
|
this.movieRequest.denied = result.denied;
|
|
|
|
this.movieRequest.deniedReason = result.reason;
|
|
|
|
this.movieRequest.deniedReason = result.reason;
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -177,7 +203,13 @@ export class MovieDetailsComponent implements OnInit{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const dialogRef = this.dialog.open(NewIssueComponent, {
|
|
|
|
const dialogRef = this.dialog.open(NewIssueComponent, {
|
|
|
|
width: '500px',
|
|
|
|
width: '500px',
|
|
|
|
data: { requestId: this.movieRequest ? this.movieRequest.id : null, requestType: RequestType.movie, providerId: provider, title: this.movie.title, posterPath: this.movie.posterPath }
|
|
|
|
data: {
|
|
|
|
|
|
|
|
requestId: this.movieRequest ? this.movieRequest.id : null,
|
|
|
|
|
|
|
|
requestType: RequestType.movie,
|
|
|
|
|
|
|
|
providerId: provider,
|
|
|
|
|
|
|
|
title: this.movie.title,
|
|
|
|
|
|
|
|
posterPath: this.movie.posterPath,
|
|
|
|
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -189,27 +221,26 @@ export class MovieDetailsComponent implements OnInit{
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.movie.approved = true;
|
|
|
|
this.movie.approved = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.messageService.send(this.translate.instant("Requests.SuccessfullyApproved"), "Ok");
|
|
|
|
this.messageService.send(this.translate.instant('Requests.SuccessfullyApproved'), 'Ok');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.messageService.sendRequestEngineResultError(result);
|
|
|
|
this.messageService.sendRequestEngineResultError(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async markAvailable(is4K: boolean) {
|
|
|
|
public async markAvailable(is4K: boolean) {
|
|
|
|
const result = await firstValueFrom(this.requestService.markMovieAvailable({ id: this.movieRequest.id, is4K }))
|
|
|
|
const result = await firstValueFrom(this.requestService.markMovieAvailable({ id: this.movieRequest.id, is4K }));
|
|
|
|
if (result.result) {
|
|
|
|
if (result.result) {
|
|
|
|
if (is4K) {
|
|
|
|
if (is4K) {
|
|
|
|
this.movie.available4K = true;
|
|
|
|
this.movie.available4K = true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.movie.available = true;
|
|
|
|
this.movie.available = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.messageService.send(this.translate.instant("Requests.NowAvailable"), "Ok");
|
|
|
|
this.messageService.send(this.translate.instant('Requests.NowAvailable'), 'Ok');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.messageService.sendRequestEngineResultError(result);
|
|
|
|
this.messageService.sendRequestEngineResultError(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async markUnavailable(is4K: boolean) {
|
|
|
|
public async markUnavailable(is4K: boolean) {
|
|
|
|
const result = await firstValueFrom(this.requestService.markMovieUnavailable({ id: this.movieRequest.id, is4K }));
|
|
|
|
const result = await firstValueFrom(this.requestService.markMovieUnavailable({ id: this.movieRequest.id, is4K }));
|
|
|
|
if (result.result) {
|
|
|
|
if (result.result) {
|
|
|
@ -218,7 +249,7 @@ export class MovieDetailsComponent implements OnInit{
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.movie.available = false;
|
|
|
|
this.movie.available = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.messageService.send(this.translate.instant("Requests.NowUnavailable"), "Ok");
|
|
|
|
this.messageService.send(this.translate.instant('Requests.NowUnavailable'), 'Ok');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.messageService.sendRequestEngineResultError(result);
|
|
|
|
this.messageService.sendRequestEngineResultError(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -227,29 +258,40 @@ export class MovieDetailsComponent implements OnInit{
|
|
|
|
public setAdvancedOptions(data: IAdvancedData) {
|
|
|
|
public setAdvancedOptions(data: IAdvancedData) {
|
|
|
|
this.advancedOptions = data;
|
|
|
|
this.advancedOptions = data;
|
|
|
|
if (data.rootFolderId) {
|
|
|
|
if (data.rootFolderId) {
|
|
|
|
this.movieRequest.qualityOverrideTitle = data.profiles.filter(x => x.id == data.profileId)[0].name;
|
|
|
|
this.movieRequest.qualityOverrideTitle = data.profiles.filter((x) => x.id == data.profileId)[0].name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (data.profileId) {
|
|
|
|
if (data.profileId) {
|
|
|
|
this.movieRequest.rootPathOverrideTitle = data.rootFolders.filter(x => x.id == data.rootFolderId)[0].path;
|
|
|
|
this.movieRequest.rootPathOverrideTitle = data.rootFolders.filter((x) => x.id == data.rootFolderId)[0].path;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async openAdvancedOptions() {
|
|
|
|
public async openAdvancedOptions() {
|
|
|
|
const dialog = this.dialog.open(MovieAdvancedOptionsComponent, { width: "700px", data: <IAdvancedData>{ movieRequest: this.movieRequest }, panelClass: 'modal-panel' })
|
|
|
|
const dialog = this.dialog.open(MovieAdvancedOptionsComponent, {
|
|
|
|
await dialog.afterClosed().subscribe(async result => {
|
|
|
|
width: '700px',
|
|
|
|
|
|
|
|
data: <IAdvancedData>{ movieRequest: this.movieRequest },
|
|
|
|
|
|
|
|
panelClass: 'modal-panel',
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
await dialog.afterClosed().subscribe(async (result) => {
|
|
|
|
if (result) {
|
|
|
|
if (result) {
|
|
|
|
result.rootFolder = result.rootFolders.filter(f => f.id === +result.rootFolderId)[0];
|
|
|
|
result.rootFolder = result.rootFolders.filter((f) => f.id === +result.rootFolderId)[0];
|
|
|
|
result.profile = result.profiles.filter(f => f.id === +result.profileId)[0];
|
|
|
|
result.profile = result.profiles.filter((f) => f.id === +result.profileId)[0];
|
|
|
|
await this.requestService2.updateMovieAdvancedOptions({ qualityOverride: result.profileId, rootPathOverride: result.rootFolderId, languageProfile: 0, requestId: this.movieRequest.id }).toPromise();
|
|
|
|
await this.requestService2
|
|
|
|
|
|
|
|
.updateMovieAdvancedOptions({
|
|
|
|
|
|
|
|
qualityOverride: result.profileId,
|
|
|
|
|
|
|
|
rootPathOverride: result.rootFolderId,
|
|
|
|
|
|
|
|
languageProfile: 0,
|
|
|
|
|
|
|
|
requestId: this.movieRequest.id,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.toPromise();
|
|
|
|
this.setAdvancedOptions(result);
|
|
|
|
this.setAdvancedOptions(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public reProcessRequest(is4K: boolean) {
|
|
|
|
public reProcessRequest(is4K: boolean) {
|
|
|
|
this.requestService2.reprocessRequest(this.movieRequest.id, RequestType.movie, is4K).subscribe(result => {
|
|
|
|
this.requestService2.reprocessRequest(this.movieRequest.id, RequestType.movie, is4K).subscribe((result) => {
|
|
|
|
if (result.result) {
|
|
|
|
if (result.result) {
|
|
|
|
this.messageService.send(result.message ? result.message : this.translate.instant("Requests.SuccessfullyReprocessed"), "Ok");
|
|
|
|
this.messageService.send(result.message ? result.message : this.translate.instant('Requests.SuccessfullyReprocessed'), 'Ok');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.messageService.sendRequestEngineResultError(result);
|
|
|
|
this.messageService.sendRequestEngineResultError(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -257,53 +299,52 @@ export class MovieDetailsComponent implements OnInit{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public notify() {
|
|
|
|
public notify() {
|
|
|
|
this.requestService.subscribeToMovie(this.movieRequest.id).subscribe(result => {
|
|
|
|
this.requestService.subscribeToMovie(this.movieRequest.id).subscribe((result) => {
|
|
|
|
if (result) {
|
|
|
|
if (result) {
|
|
|
|
this.movie.subscribed = true;
|
|
|
|
this.movie.subscribed = true;
|
|
|
|
this.messageService.send(this.translate.instant("Requests.SuccessfulNotify", {title: this.movie.title}), "Ok");
|
|
|
|
this.messageService.send(this.translate.instant('Requests.SuccessfulNotify', { title: this.movie.title }), 'Ok');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.messageService.send(this.translate.instant("Requests.CouldntNotify", {title: this.movie.title}), "Ok");
|
|
|
|
this.messageService.send(this.translate.instant('Requests.CouldntNotify', { title: this.movie.title }), 'Ok');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public unNotify() {
|
|
|
|
public unNotify() {
|
|
|
|
this.requestService.unSubscribeToMovie(this.movieRequest.id).subscribe(result => {
|
|
|
|
this.requestService.unSubscribeToMovie(this.movieRequest.id).subscribe((result) => {
|
|
|
|
if (result) {
|
|
|
|
if (result) {
|
|
|
|
this.movie.subscribed = false;
|
|
|
|
this.movie.subscribed = false;
|
|
|
|
this.messageService.send(this.translate.instant("Requests.SuccessfulUnNotify", {title: this.movie.title}), "Ok");
|
|
|
|
this.messageService.send(this.translate.instant('Requests.SuccessfulUnNotify', { title: this.movie.title }), 'Ok');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.messageService.send(this.translate.instant("Requests.CouldntNotify", {title: this.movie.title}), "Ok");
|
|
|
|
this.messageService.send(this.translate.instant('Requests.CouldntNotify', { title: this.movie.title }), 'Ok');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private loadBanner() {
|
|
|
|
private loadBanner() {
|
|
|
|
this.imageService.getMovieBanner(this.theMovidDbId.toString()).subscribe(x => {
|
|
|
|
this.imageService.getMovieBanner(this.theMovidDbId.toString()).subscribe((x) => {
|
|
|
|
if (!this.movie.backdropPath) {
|
|
|
|
if (!this.movie.backdropPath) {
|
|
|
|
this.movie.background = this.sanitizer.bypassSecurityTrustStyle
|
|
|
|
this.movie.background = this.sanitizer.bypassSecurityTrustStyle('url(' + x + ')');
|
|
|
|
("url(" + x + ")");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.movie.background = this.sanitizer.bypassSecurityTrustStyle
|
|
|
|
this.movie.background = this.sanitizer.bypassSecurityTrustStyle(
|
|
|
|
("url(https://image.tmdb.org/t/p/original/" + this.movie.backdropPath + ")");
|
|
|
|
'url(https://image.tmdb.org/t/p/original/' + this.movie.backdropPath + ')',
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private checkPoster() {
|
|
|
|
private checkPoster() {
|
|
|
|
if (this.movie.posterPath == null) {
|
|
|
|
if (this.movie.posterPath == null) {
|
|
|
|
this.movie.posterPath = "../../../images/default_movie_poster.png";
|
|
|
|
this.movie.posterPath = '../../../images/default_movie_poster.png';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.movie.posterPath = 'https://image.tmdb.org/t/p/w300/' + this.movie.posterPath;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
|
|
|
|
this.movie.posterPath = "https://image.tmdb.org/t/p/w300/" + this.movie.posterPath
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private loadAdvancedInfo() {
|
|
|
|
private loadAdvancedInfo() {
|
|
|
|
const profile = this.radarrService.getQualityProfilesFromSettings();
|
|
|
|
const profile = this.radarrService.getQualityProfilesFromSettings();
|
|
|
|
const folders = this.radarrService.getRootFoldersFromSettings();
|
|
|
|
const folders = this.radarrService.getRootFoldersFromSettings();
|
|
|
|
|
|
|
|
|
|
|
|
forkJoin([profile, folders]).subscribe(x => {
|
|
|
|
forkJoin([profile, folders]).subscribe((x) => {
|
|
|
|
const radarrProfiles = x[0];
|
|
|
|
const radarrProfiles = x[0] ?? [];
|
|
|
|
const radarrRootFolders = x[1];
|
|
|
|
const radarrRootFolders = x[1] ?? [];
|
|
|
|
|
|
|
|
|
|
|
|
const profile = radarrProfiles.filter((p) => {
|
|
|
|
const profile = radarrProfiles.filter((p) => {
|
|
|
|
return p.id === this.movieRequest.qualityOverride;
|
|
|
|
return p.id === this.movieRequest.qualityOverride;
|
|
|
@ -318,15 +359,14 @@ export class MovieDetailsComponent implements OnInit{
|
|
|
|
if (path.length > 0) {
|
|
|
|
if (path.length > 0) {
|
|
|
|
this.movieRequest.rootPathOverrideTitle = path[0].path;
|
|
|
|
this.movieRequest.rootPathOverrideTitle = path[0].path;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private orderCrew(crew: ICrewViewModel[]): ICrewViewModel[] {
|
|
|
|
private orderCrew(crew: ICrewViewModel[]): ICrewViewModel[] {
|
|
|
|
return crew.sort((a, b) => {
|
|
|
|
return crew.sort((a, b) => {
|
|
|
|
if (a.job === "Director") {
|
|
|
|
if (a.job === 'Director') {
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
} else if (b.job === "Director") {
|
|
|
|
} else if (b.job === 'Director') {
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|