mirror of https://github.com/Ombi-app/Ombi
commit
dde517cecc
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,55 +1,92 @@
|
||||
import { Component, Inject, OnInit } from "@angular/core";
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
|
||||
import { IAdvancedData, ISonarrProfile, ISonarrRootFolder } from "../../../../../interfaces";
|
||||
import { SonarrService } from "../../../../../services";
|
||||
import {
|
||||
IAdvancedData,
|
||||
ILanguageProfiles,
|
||||
ISonarrProfile,
|
||||
ISonarrRootFolder,
|
||||
ISonarrSettings,
|
||||
} from "../../../../../interfaces";
|
||||
import { SettingsService, SonarrService } from "../../../../../services";
|
||||
|
||||
@Component({
|
||||
templateUrl: "./tv-advanced-options.component.html",
|
||||
selector: "tv-advanced-options",
|
||||
templateUrl: "./tv-advanced-options.component.html",
|
||||
selector: "tv-advanced-options",
|
||||
})
|
||||
export class TvAdvancedOptionsComponent implements OnInit {
|
||||
public sonarrProfiles: ISonarrProfile[];
|
||||
public sonarrRootFolders: ISonarrRootFolder[];
|
||||
public sonarrLanguageProfiles: ILanguageProfiles[];
|
||||
public sonarrEnabled: boolean;
|
||||
|
||||
public sonarrProfiles: ISonarrProfile[];
|
||||
public sonarrRootFolders: ISonarrRootFolder[];
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<TvAdvancedOptionsComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: IAdvancedData,
|
||||
private sonarrService: SonarrService,
|
||||
private settingsService: SettingsService
|
||||
) {}
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<TvAdvancedOptionsComponent>, @Inject(MAT_DIALOG_DATA) public data: IAdvancedData,
|
||||
private sonarrService: SonarrService
|
||||
) {
|
||||
}
|
||||
public async ngOnInit() {
|
||||
this.settingsService.getSonarr().subscribe((settings: ISonarrSettings) => {
|
||||
if (!settings.enabled) {
|
||||
this.sonarrEnabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
this.sonarrEnabled = true;
|
||||
this.sonarrService.getQualityProfilesWithoutSettings().subscribe((c) => {
|
||||
this.sonarrProfiles = c;
|
||||
this.data.profiles = c;
|
||||
this.setQualityOverrides();
|
||||
});
|
||||
this.sonarrService.getRootFoldersWithoutSettings().subscribe((c) => {
|
||||
this.sonarrRootFolders = c;
|
||||
this.data.rootFolders = c;
|
||||
this.setRootFolderOverrides();
|
||||
});
|
||||
|
||||
if (settings.v3) {
|
||||
this.sonarrService
|
||||
.getV3LanguageProfiles(settings)
|
||||
.subscribe((profiles: ILanguageProfiles[]) => {
|
||||
this.sonarrLanguageProfiles = profiles;
|
||||
this.data.languages = profiles;
|
||||
this.setLanguageOverride();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public async ngOnInit() {
|
||||
this.sonarrService.getQualityProfilesWithoutSettings().subscribe(c => {
|
||||
this.sonarrProfiles = c;
|
||||
this.data.profiles = c;
|
||||
this.setQualityOverrides();
|
||||
});
|
||||
this.sonarrService.getRootFoldersWithoutSettings().subscribe(c => {
|
||||
this.sonarrRootFolders = c;
|
||||
this.data.rootFolders = c;
|
||||
this.setRootFolderOverrides();
|
||||
});
|
||||
private setQualityOverrides(): void {
|
||||
if (this.sonarrProfiles) {
|
||||
const profile = this.sonarrProfiles.filter((p) => {
|
||||
return p.id === this.data.tvRequest.qualityOverride;
|
||||
});
|
||||
if (profile.length > 0) {
|
||||
this.data.tvRequest.qualityOverrideTitle = profile[0].name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private setQualityOverrides(): void {
|
||||
if (this.sonarrProfiles) {
|
||||
const profile = this.sonarrProfiles.filter((p) => {
|
||||
return p.id === this.data.tvRequest.qualityOverride;
|
||||
});
|
||||
if (profile.length > 0) {
|
||||
this.data.movieRequest.qualityOverrideTitle = profile[0].name;
|
||||
}
|
||||
}
|
||||
private setRootFolderOverrides(): void {
|
||||
if (this.sonarrRootFolders) {
|
||||
const path = this.sonarrRootFolders.filter((folder) => {
|
||||
return folder.id === this.data.tvRequest.rootFolder;
|
||||
});
|
||||
if (path.length > 0) {
|
||||
this.data.tvRequest.rootPathOverrideTitle = path[0].path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private setRootFolderOverrides(): void {
|
||||
if (this.sonarrRootFolders) {
|
||||
const path = this.sonarrRootFolders.filter((folder) => {
|
||||
return folder.id === this.data.tvRequest.rootFolder;
|
||||
});
|
||||
if (path.length > 0) {
|
||||
this.data.movieRequest.rootPathOverrideTitle = path[0].path;
|
||||
}
|
||||
}
|
||||
private setLanguageOverride(): void {
|
||||
if (this.sonarrLanguageProfiles) {
|
||||
const profile = this.sonarrLanguageProfiles.filter((p) => {
|
||||
return p.id === this.data.tvRequest.languageProfile;
|
||||
});
|
||||
if (profile.length > 0) {
|
||||
this.data.tvRequest.languageOverrideTitle = profile[0].name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<form [formGroup]='searchForm'>
|
||||
<mat-form-field floatLabel="never" style="width: 100%;">
|
||||
<input id="nav-search" matInput placeholder="{{'NavigationBar.Search' | translate}}" formControlName='input'>
|
||||
<input id="nav-search" autofocus="autofocus" matInput placeholder="{{'NavigationBar.Search' | translate}}" formControlName='input'>
|
||||
</mat-form-field>
|
||||
</form>
|
@ -0,0 +1,18 @@
|
||||
import { PlatformLocation, APP_BASE_HREF } from "@angular/common";
|
||||
import { Injectable, Inject } from "@angular/core";
|
||||
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
import { ServiceHelpers } from "./service.helpers";
|
||||
import { IUpdateModel } from "../interfaces";
|
||||
|
||||
@Injectable()
|
||||
export class UpdateService extends ServiceHelpers {
|
||||
constructor(http: HttpClient, @Inject(APP_BASE_HREF) href:string) {
|
||||
super(http, "/api/v1/Update/", href);
|
||||
}
|
||||
public checkForUpdate(): Observable<IUpdateModel> {
|
||||
return this.http.get<IUpdateModel>(`${this.url}`, {headers: this.headers});
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
<h1 mat-dialog-title><i class="fas fa-code-branch"></i> Latest Version: {{data.updateVersionString}}</h1>
|
||||
<mat-dialog-content>
|
||||
<div [innerHTML]="data.changeLogs">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="mat-table">
|
||||
<div class="mat-header-row">
|
||||
<div class="mat-header-cell">Binary</div>
|
||||
<div class="mat-header-cell">Download</div></div>
|
||||
<div *ngFor="let d of data.downloads" class="mat-row" >
|
||||
<div class="mat-cell">{{d.name}}</div>
|
||||
<div class="mat-cell"><a href="{{d.url}}">Download</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<small>Updated at {{data.updateDate | date}}</small>
|
||||
</mat-dialog-content>
|
||||
|
||||
|
||||
<div mat-dialog-actions class="right-buttons">
|
||||
<button mat-raised-button id="cancelButton" [mat-dialog-close]="" color="warn"><i class="fas fa-times"></i> Close</button>
|
||||
</div>
|
||||
|
@ -0,0 +1,40 @@
|
||||
.mat-table {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.mat-row,
|
||||
.mat-header-row {
|
||||
display: flex;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
align-items: center;
|
||||
min-height: 48px;
|
||||
padding: 0 24px;
|
||||
}
|
||||
|
||||
.mat-cell,
|
||||
.mat-header-cell {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.small-middle-container{
|
||||
margin: auto;
|
||||
width: 85%;
|
||||
margin-top:10px;
|
||||
}
|
||||
|
||||
:host ::ng-deep strong {
|
||||
color: #fff;
|
||||
background-color: #007bff;
|
||||
display: inline-block;
|
||||
padding: 0.25em 0.4em;
|
||||
font-size: 75%;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: baseline;
|
||||
border-radius: 0.25rem;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue