mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
started on the admin panel
This commit is contained in:
parent
957f7db195
commit
8f3dd86c52
9 changed files with 170 additions and 76 deletions
|
@ -20,7 +20,7 @@ export class DiscoverCardDetailsComponent implements OnInit {
|
||||||
public tv: ISearchTvResultV2;
|
public tv: ISearchTvResultV2;
|
||||||
public tvCreator: string;
|
public tvCreator: string;
|
||||||
public tvProducer: string;
|
public tvProducer: string;
|
||||||
public loading: boolean;;
|
public loading: boolean;
|
||||||
public RequestType = RequestType;
|
public RequestType = RequestType;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -77,7 +77,6 @@ export class DiscoverCardDetailsComponent implements OnInit {
|
||||||
this.messageService.send(result.errorMessage, "Ok");
|
this.messageService.send(result.errorMessage, "Ok");
|
||||||
}
|
}
|
||||||
} else if (this.data.type === RequestType.tvShow) {
|
} else if (this.data.type === RequestType.tvShow) {
|
||||||
|
|
||||||
this.dialog.open(EpisodeRequestComponent, { width: "700px", data: this.tv, panelClass: 'modal-panel' })
|
this.dialog.open(EpisodeRequestComponent, { width: "700px", data: this.tv, panelClass: 'modal-panel' })
|
||||||
}
|
}
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
|
@ -17,3 +17,13 @@ export interface IMinimumAvailability {
|
||||||
value: string;
|
value: string;
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IAdvancedModel {
|
||||||
|
profile: IRadarrProfile;
|
||||||
|
rootFolder: IRadarrRootFolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IAdvancedData {
|
||||||
|
profiles: IRadarrProfile[];
|
||||||
|
rootFolders: IRadarrRootFolder[];
|
||||||
|
}
|
|
@ -9,6 +9,8 @@ import { MediaPosterComponent } from "./shared/media-poster/media-poster.compone
|
||||||
import { CastCarouselComponent } from "./shared/cast-carousel/cast-carousel.component";
|
import { CastCarouselComponent } from "./shared/cast-carousel/cast-carousel.component";
|
||||||
import { DenyDialogComponent } from "./shared/deny-dialog/deny-dialog.component";
|
import { DenyDialogComponent } from "./shared/deny-dialog/deny-dialog.component";
|
||||||
import { TvRequestsPanelComponent } from "./tv/panels/tv-requests/tv-requests-panel.component";
|
import { TvRequestsPanelComponent } from "./tv/panels/tv-requests/tv-requests-panel.component";
|
||||||
|
import { MovieAdminPanelComponent } from "./movie/panels/movie-admin-panel/movie-admin-panel.component";
|
||||||
|
import { MovieAdvancedOptionsComponent } from "./movie/panels/movie-advanced-options/movie-advanced-options.component";
|
||||||
|
|
||||||
export const components: any[] = [
|
export const components: any[] = [
|
||||||
MovieDetailsComponent,
|
MovieDetailsComponent,
|
||||||
|
@ -21,7 +23,9 @@ export const components: any[] = [
|
||||||
MediaPosterComponent,
|
MediaPosterComponent,
|
||||||
CastCarouselComponent,
|
CastCarouselComponent,
|
||||||
DenyDialogComponent,
|
DenyDialogComponent,
|
||||||
TvRequestsPanelComponent
|
TvRequestsPanelComponent,
|
||||||
|
MovieAdminPanelComponent,
|
||||||
|
MovieAdvancedOptionsComponent
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,4 +33,5 @@ export const components: any[] = [
|
||||||
export const entryComponents: any[] = [
|
export const entryComponents: any[] = [
|
||||||
YoutubeTrailerComponent,
|
YoutubeTrailerComponent,
|
||||||
DenyDialogComponent,
|
DenyDialogComponent,
|
||||||
|
MovieAdvancedOptionsComponent,
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
|
<div *ngIf="!movie" class="row justify-content-md-center top-spacing loading-spinner">
|
||||||
|
<mat-spinner [color]="'accent'"></mat-spinner>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div *ngIf="movie" class="dark-theme">
|
<div *ngIf="movie" class="dark-theme">
|
||||||
|
|
||||||
<top-banner [background]="movie.background" [available]="movie.available" [title]="movie.title" [releaseDate]="movie.releaseDate"
|
<top-banner [background]="movie.background" [available]="movie.available" [title]="movie.title"
|
||||||
[tagline]="movie.tagline"></top-banner>
|
[releaseDate]="movie.releaseDate" [tagline]="movie.tagline"></top-banner>
|
||||||
|
|
||||||
<section id="info-wrapper">
|
<section id="info-wrapper">
|
||||||
<div class="small-middle-container">
|
<div class="small-middle-container">
|
||||||
|
@ -13,8 +17,9 @@
|
||||||
<!--Next to poster-->
|
<!--Next to poster-->
|
||||||
<div class="col-12 col-lg-3 col-xl-3 media-row">
|
<div class="col-12 col-lg-3 col-xl-3 media-row">
|
||||||
|
|
||||||
<social-icons [homepage]="movie.homepage" [theMoviedbId]="movie.id" [hasTrailer]="movie.videos.results.length > 0"
|
<social-icons [homepage]="movie.homepage" [theMoviedbId]="movie.id"
|
||||||
(openTrailer)="openDialog()" [imdbId]="movie.imdbId" [twitter]="movie.externalIds.twitterId" [facebook]="movie.externalIds.facebookId"
|
[hasTrailer]="movie.videos.results.length > 0" (openTrailer)="openDialog()" [imdbId]="movie.imdbId"
|
||||||
|
[twitter]="movie.externalIds.twitterId" [facebook]="movie.externalIds.facebookId"
|
||||||
[instagram]="movie.externalIds.instagramId" [available]="movie.available" [plexUrl]="movie.plexUrl"
|
[instagram]="movie.externalIds.instagramId" [available]="movie.available" [plexUrl]="movie.plexUrl"
|
||||||
[embyUrl]="movie.embyUrl"></social-icons>
|
[embyUrl]="movie.embyUrl"></social-icons>
|
||||||
|
|
||||||
|
@ -28,13 +33,14 @@
|
||||||
<span *ngIf="movie.requested || movie.approved; then requestedBtn else notRequestedBtn"></span>
|
<span *ngIf="movie.requested || movie.approved; then requestedBtn else notRequestedBtn"></span>
|
||||||
|
|
||||||
<ng-template #requestedBtn>
|
<ng-template #requestedBtn>
|
||||||
<button mat-raised-button *ngIf="!hasRequest || hasRequest && !movieRequest.denied" class="btn-spacing" color="warn" [disabled]><i class="fa fa-check"></i>
|
<button mat-raised-button *ngIf="!hasRequest || hasRequest && movieRequest && !movieRequest.denied" class="btn-spacing"
|
||||||
|
color="warn" [disabled]><i class="fa fa-check"></i>
|
||||||
{{ 'Common.Requested' | translate }}</button>
|
{{ 'Common.Requested' | translate }}</button>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<ng-template #notRequestedBtn>
|
<ng-template #notRequestedBtn>
|
||||||
<button mat-raised-button class="btn-spacing" color="primary" (click)="request()">
|
<button mat-raised-button class="btn-spacing" color="primary" (click)="request()">
|
||||||
<i *ngIf="movie.requestProcessing" class="fa fa-circle-o-notch fa-spin fa-fw"></i> <i *ngIf="!movie.requestProcessing && !movie.processed"
|
<i *ngIf="movie.requestProcessing" class="fa fa-circle-o-notch fa-spin fa-fw"></i> <i
|
||||||
class="fa fa-plus"></i>
|
*ngIf="!movie.requestProcessing && !movie.processed" class="fa fa-plus"></i>
|
||||||
<i *ngIf="movie.processed && !movie.requestProcessing" class="fa fa-check"></i> {{
|
<i *ngIf="movie.processed && !movie.requestProcessing" class="fa fa-check"></i> {{
|
||||||
'Common.Request' | translate }}</button>
|
'Common.Request' | translate }}</button>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
@ -43,23 +49,26 @@
|
||||||
<button (click)="approve()" mat-raised-button class="btn-spacing" color="accent">
|
<button (click)="approve()" mat-raised-button class="btn-spacing" color="accent">
|
||||||
<i class="fa fa-plus"></i> {{ 'Common.Approve' | translate }}
|
<i class="fa fa-plus"></i> {{ 'Common.Approve' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="!movie.available" (click)="markAvailable()" mat-raised-button class="btn-spacing" color="accent">
|
<button *ngIf="!movie.available" (click)="markAvailable()" mat-raised-button class="btn-spacing"
|
||||||
|
color="accent">
|
||||||
<i class="fa fa-plus"></i> {{ 'Requests.MarkAvailable' | translate }}
|
<i class="fa fa-plus"></i> {{ 'Requests.MarkAvailable' | translate }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button *ngIf="hasRequest && !movieRequest.denied" mat-raised-button class="btn-spacing" color="warn" (click)="deny()">
|
<button *ngIf="hasRequest && !movieRequest.denied" mat-raised-button class="btn-spacing" color="warn"
|
||||||
<i class="fa fa-times"></i> {{
|
(click)="deny()">
|
||||||
|
<i class="fa fa-times"></i> {{
|
||||||
'Requests.Deny' | translate }}</button>
|
'Requests.Deny' | translate }}</button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<button *ngIf="hasRequest && movieRequest.denied" [matTooltip]="movieRequest.deniedReason" mat-raised-button class="btn-spacing" color="warn">
|
<button *ngIf="hasRequest && movieRequest.denied" [matTooltip]="movieRequest.deniedReason" mat-raised-button
|
||||||
<i class="fa fa-times"></i> {{
|
class="btn-spacing" color="warn">
|
||||||
|
<i class="fa fa-times"></i> {{
|
||||||
'MediaDetails.Denied' | translate }}</button>
|
'MediaDetails.Denied' | translate }}</button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -67,13 +76,23 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-12 col-md-2">
|
<div class="col-12 col-md-2">
|
||||||
<button *ngIf="movie.belongsToCollection" [routerLink]="'/discover/collection/' + movie.belongsToCollection.id" mat-raised-button class="spacing-below full-width mat-elevation-z8">{{movie.belongsToCollection.name}}</button>
|
<button *ngIf="movie.belongsToCollection"
|
||||||
|
[routerLink]="'/discover/collection/' + movie.belongsToCollection.id" mat-raised-button
|
||||||
|
class="spacing-below full-width mat-elevation-z8">{{movie.belongsToCollection.name}}</button>
|
||||||
|
|
||||||
|
<mat-card class="mat-elevation-z8 spacing-below" *ngIf="isAdmin && movieRequest">
|
||||||
|
<mat-card-content class="medium-font">
|
||||||
|
<movie-admin-panel [movie]="movieRequest"></movie-admin-panel>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
|
||||||
<mat-card class="mat-elevation-z8">
|
<mat-card class="mat-elevation-z8">
|
||||||
<mat-card-content class="medium-font">
|
<mat-card-content class="medium-font">
|
||||||
<movie-information-panel [movie]="movie"></movie-information-panel>
|
<movie-information-panel [movie]="movie"></movie-information-panel>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 col-md-10">
|
<div class="col-12 col-md-10">
|
||||||
|
@ -84,14 +103,12 @@
|
||||||
{{movie.overview}}
|
{{movie.overview}}
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<cast-carousel [cast]="movie.credits.cast"></cast-carousel>
|
<cast-carousel [cast]="movie.credits.cast"></cast-carousel>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -101,7 +118,7 @@
|
||||||
<mat-expansion-panel>
|
<mat-expansion-panel>
|
||||||
<mat-expansion-panel-header>
|
<mat-expansion-panel-header>
|
||||||
<mat-panel-title>
|
<mat-panel-title>
|
||||||
{{'MediaDetails.RecommendationsTitle' | translate}}
|
{{'MediaDetails.RecommendationsTitle' | translate}}
|
||||||
</mat-panel-title>
|
</mat-panel-title>
|
||||||
</mat-expansion-panel-header>
|
</mat-expansion-panel-header>
|
||||||
|
|
||||||
|
@ -111,8 +128,9 @@
|
||||||
<div class="sidebar affixable affix-top preview-poster">
|
<div class="sidebar affixable affix-top preview-poster">
|
||||||
<div class="poster">
|
<div class="poster">
|
||||||
<a [routerLink]="'/details/movie/'+r.id">
|
<a [routerLink]="'/details/movie/'+r.id">
|
||||||
<img class="real grow" matTooltip="{{r.title}}" src="https://image.tmdb.org/t/p/w300/{{r.poster_path}}"
|
<img class="real grow" matTooltip="{{r.title}}"
|
||||||
alt="Poster" style="display: block;">
|
src="https://image.tmdb.org/t/p/w300/{{r.poster_path}}" alt="Poster"
|
||||||
|
style="display: block;">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -123,7 +141,7 @@
|
||||||
<mat-expansion-panel>
|
<mat-expansion-panel>
|
||||||
<mat-expansion-panel-header>
|
<mat-expansion-panel-header>
|
||||||
<mat-panel-title>
|
<mat-panel-title>
|
||||||
{{'MediaDetails.SimilarTitle' | translate}}
|
{{'MediaDetails.SimilarTitle' | translate}}
|
||||||
</mat-panel-title>
|
</mat-panel-title>
|
||||||
</mat-expansion-panel-header>
|
</mat-expansion-panel-header>
|
||||||
|
|
||||||
|
@ -133,8 +151,9 @@
|
||||||
<div class="sidebar affixable affix-top preview-poster">
|
<div class="sidebar affixable affix-top preview-poster">
|
||||||
<div class="poster ">
|
<div class="poster ">
|
||||||
<a [routerLink]="'/details/movie/'+r.id">
|
<a [routerLink]="'/details/movie/'+r.id">
|
||||||
<img class="real grow" matTooltip="{{r.title}}" src="https://image.tmdb.org/t/p/w300/{{r.poster_path}}"
|
<img class="real grow" matTooltip="{{r.title}}"
|
||||||
alt="Poster" style="display: block;">
|
src="https://image.tmdb.org/t/p/w300/{{r.poster_path}}" alt="Poster"
|
||||||
|
style="display: block;">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -145,7 +164,7 @@
|
||||||
<mat-expansion-panel>
|
<mat-expansion-panel>
|
||||||
<mat-expansion-panel-header>
|
<mat-expansion-panel-header>
|
||||||
<mat-panel-title>
|
<mat-panel-title>
|
||||||
{{'MediaDetails.VideosTitle' | translate}}
|
{{'MediaDetails.VideosTitle' | translate}}
|
||||||
</mat-panel-title>
|
</mat-panel-title>
|
||||||
</mat-expansion-panel-header>
|
</mat-expansion-panel-header>
|
||||||
|
|
||||||
|
@ -186,4 +205,4 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
|
@ -1,12 +1,12 @@
|
||||||
import { Component, ViewEncapsulation } from "@angular/core";
|
import { Component, ViewEncapsulation } from "@angular/core";
|
||||||
import { ImageService, SearchV2Service, RequestService, MessageService, RadarrService } from "../../../services";
|
import { ImageService, SearchV2Service, RequestService, MessageService } from "../../../services";
|
||||||
import { ActivatedRoute } from "@angular/router";
|
import { ActivatedRoute } from "@angular/router";
|
||||||
import { DomSanitizer } from "@angular/platform-browser";
|
import { DomSanitizer } from "@angular/platform-browser";
|
||||||
import { ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2";
|
import { ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2";
|
||||||
import { MatDialog } from "@angular/material";
|
import { MatDialog } from "@angular/material";
|
||||||
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, IRadarrProfile, IRadarrRootFolder, RequestType } from "../../../interfaces";
|
import { IMovieRequests, RequestType } from "../../../interfaces";
|
||||||
import { DenyDialogComponent } from "../shared/deny-dialog/deny-dialog.component";
|
import { DenyDialogComponent } from "../shared/deny-dialog/deny-dialog.component";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -20,16 +20,12 @@ export class MovieDetailsComponent {
|
||||||
public movieRequest: IMovieRequests;
|
public movieRequest: IMovieRequests;
|
||||||
public isAdmin: boolean;
|
public isAdmin: boolean;
|
||||||
|
|
||||||
public radarrProfiles: IRadarrProfile[];
|
|
||||||
public radarrRootFolders: IRadarrRootFolder[];
|
|
||||||
|
|
||||||
private theMovidDbId: number;
|
private theMovidDbId: number;
|
||||||
|
|
||||||
constructor(private searchService: SearchV2Service, private route: ActivatedRoute,
|
constructor(private searchService: SearchV2Service, private route: ActivatedRoute,
|
||||||
private sanitizer: DomSanitizer, private imageService: ImageService,
|
private sanitizer: DomSanitizer, private imageService: ImageService,
|
||||||
public dialog: MatDialog, private requestService: RequestService,
|
public dialog: MatDialog, private requestService: RequestService,
|
||||||
public messageService: MessageService, private auth: AuthService,
|
public messageService: MessageService, private auth: AuthService) {
|
||||||
private radarrService: RadarrService) {
|
|
||||||
this.route.params.subscribe((params: any) => {
|
this.route.params.subscribe((params: any) => {
|
||||||
this.theMovidDbId = params.movieDbId;
|
this.theMovidDbId = params.movieDbId;
|
||||||
this.load();
|
this.load();
|
||||||
|
@ -45,20 +41,6 @@ export class MovieDetailsComponent {
|
||||||
// Load up this request
|
// Load up this request
|
||||||
this.hasRequest = true;
|
this.hasRequest = true;
|
||||||
this.movieRequest = await this.requestService.getMovieRequest(this.movie.requestId);
|
this.movieRequest = await this.requestService.getMovieRequest(this.movie.requestId);
|
||||||
|
|
||||||
if (this.isAdmin) {
|
|
||||||
if (await this.radarrService.isRadarrEnabled()) {
|
|
||||||
this.radarrService.getQualityProfilesFromSettings().subscribe(c => {
|
|
||||||
this.radarrProfiles = c;
|
|
||||||
this.setQualityOverrides();
|
|
||||||
});
|
|
||||||
this.radarrService.getRootFoldersFromSettings().subscribe(c => {
|
|
||||||
this.radarrRootFolders = c;
|
|
||||||
this.setRootFolderOverrides();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
this.imageService.getMovieBanner(this.theMovidDbId.toString()).subscribe(x => {
|
this.imageService.getMovieBanner(this.theMovidDbId.toString()).subscribe(x => {
|
||||||
this.movie.background = this.sanitizer.bypassSecurityTrustStyle
|
this.movie.background = this.sanitizer.bypassSecurityTrustStyle
|
||||||
|
@ -118,26 +100,4 @@ export class MovieDetailsComponent {
|
||||||
this.messageService.send(result.errorMessage, "Ok");
|
this.messageService.send(result.errorMessage, "Ok");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private setQualityOverrides(): void {
|
|
||||||
if (this.radarrProfiles) {
|
|
||||||
const profile = this.radarrProfiles.filter((p) => {
|
|
||||||
return p.id === this.movieRequest.qualityOverride;
|
|
||||||
});
|
|
||||||
if (profile.length > 0) {
|
|
||||||
this.movieRequest.qualityOverrideTitle = profile[0].name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private setRootFolderOverrides(): void {
|
|
||||||
if (this.radarrRootFolders) {
|
|
||||||
const path = this.radarrRootFolders.filter((folder) => {
|
|
||||||
return folder.id === this.movieRequest.rootPathOverride;
|
|
||||||
});
|
|
||||||
if (path.length > 0) {
|
|
||||||
this.movieRequest.rootPathOverrideTitle = path[0].path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
<div *ngIf="movie">
|
||||||
|
<button mat-raised-button color="warn" class="text-center" (click)="openAdvancedOptions();">Advanced Options</button>
|
||||||
|
</div>
|
|
@ -0,0 +1,63 @@
|
||||||
|
import { Component, Input, OnInit } from "@angular/core";
|
||||||
|
import { RadarrService } from "../../../../../services";
|
||||||
|
import { IRadarrProfile, IRadarrRootFolder, IMovieRequests, IAdvancedData } from "../../../../../interfaces";
|
||||||
|
import { MatDialog } from "@angular/material";
|
||||||
|
import { MovieAdvancedOptionsComponent } from "../movie-advanced-options/movie-advanced-options.component";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
templateUrl: "./movie-admin-panel.component.html",
|
||||||
|
selector: "movie-admin-panel",
|
||||||
|
})
|
||||||
|
export class MovieAdminPanelComponent implements OnInit {
|
||||||
|
|
||||||
|
@Input() public movie: IMovieRequests;
|
||||||
|
|
||||||
|
public radarrProfiles: IRadarrProfile[];
|
||||||
|
public selectedRadarrProfile: IRadarrProfile;
|
||||||
|
public radarrRootFolders: IRadarrRootFolder[];
|
||||||
|
public selectRadarrRootFolders: IRadarrRootFolder;
|
||||||
|
|
||||||
|
constructor(private radarrService: RadarrService, private dialog: MatDialog) { }
|
||||||
|
|
||||||
|
public async ngOnInit() {
|
||||||
|
if (await this.radarrService.isRadarrEnabled()) {
|
||||||
|
this.radarrService.getQualityProfilesFromSettings().subscribe(c => {
|
||||||
|
this.radarrProfiles = c;
|
||||||
|
this.setQualityOverrides();
|
||||||
|
});
|
||||||
|
this.radarrService.getRootFoldersFromSettings().subscribe(c => {
|
||||||
|
this.radarrRootFolders = c;
|
||||||
|
this.setRootFolderOverrides();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public openAdvancedOptions() {
|
||||||
|
const dialog = this.dialog.open(MovieAdvancedOptionsComponent, { width: "700px", data: <IAdvancedData>{ profiles: this.radarrProfiles, rootFolders: this.radarrRootFolders }, panelClass: 'modal-panel' })
|
||||||
|
dialog.afterClosed().subscribe(result => {
|
||||||
|
console.log(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private setQualityOverrides(): void {
|
||||||
|
if (this.radarrProfiles) {
|
||||||
|
const profile = this.radarrProfiles.filter((p) => {
|
||||||
|
return p.id === this.movie.qualityOverride;
|
||||||
|
});
|
||||||
|
if (profile.length > 0) {
|
||||||
|
this.movie.qualityOverrideTitle = profile[0].name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private setRootFolderOverrides(): void {
|
||||||
|
if (this.radarrRootFolders) {
|
||||||
|
const path = this.radarrRootFolders.filter((folder) => {
|
||||||
|
return folder.id === this.movie.rootPathOverride;
|
||||||
|
});
|
||||||
|
if (path.length > 0) {
|
||||||
|
this.movie.rootPathOverrideTitle = path[0].path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
|
||||||
|
|
||||||
|
<h1 mat-dialog-title>Advanced Options</h1>
|
||||||
|
<div mat-dialog-content>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-label>Radarr Quality Profile</mat-label>
|
||||||
|
<mat-select [(value)]="options.profile">
|
||||||
|
<mat-option *ngFor="let profile of data.profiles" value="{{profile.id}}">{{profile.name}}</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-label>Radarr Root Folders</mat-label>
|
||||||
|
<mat-select [(value)]="options.rootFolder">
|
||||||
|
<mat-option *ngFor="let profile of data.rootFolders" value="{{profile.id}}">{{profile.path}}</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div mat-dialog-actions>
|
||||||
|
<button mat-button [mat-dialog-close]="selectedRadarrProfile" cdkFocusInitial>Ok</button>
|
||||||
|
</div>
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { Component, Inject } from "@angular/core";
|
||||||
|
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material";
|
||||||
|
import { IAdvancedModel, IAdvancedData } from "../../../../../interfaces";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
templateUrl: "./movie-advanced-options.component.html",
|
||||||
|
selector: "movie-advanced-options",
|
||||||
|
})
|
||||||
|
export class MovieAdvancedOptionsComponent {
|
||||||
|
|
||||||
|
public options: IAdvancedModel;
|
||||||
|
|
||||||
|
constructor(public dialogRef: MatDialogRef<MovieAdvancedOptionsComponent>, @Inject(MAT_DIALOG_DATA) public data: IAdvancedData) { }
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue