You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/src/Ombi/ClientApp/src/app/wizard/jellyfin/jellyfin.component.ts

53 lines
1.5 KiB

import { Component, OnInit } from "@angular/core";
import { IJellyfinSettings } from "../../interfaces";
import { JellyfinService } from "../../services";
import { NotificationService } from "../../services";
@Component({
selector: "wizard-jellyfin",
templateUrl: "./jellyfin.component.html",
styleUrls: ["../welcome/welcome.component.scss"]
})
export class JellyfinComponent implements OnInit {
public jellyfinSettings: IJellyfinSettings;
constructor(private jellyfinService: JellyfinService,
private notificationService: NotificationService) {
}
public ngOnInit() {
this.jellyfinSettings = {
servers: [],
id: 0,
enable: true,
};
this.jellyfinSettings.servers.push({
ip: "",
administratorId: "",
id: 0,
apiKey: "",
enableEpisodeSearching: false,
name: "Default",
port: 8096,
ssl: false,
subDir: "",
serverHostname: "",
serverId: undefined,
jellyfinSelectedLibraries: []
});
}
public save() {
this.jellyfinService.logIn(this.jellyfinSettings).subscribe(x => {
if (x == null || !x.servers[0].apiKey) {
this.notificationService.error("Username or password was incorrect. Could not authenticate with Jellyfin.");
return;
}
this.notificationService.success("Done! Please press next");
});
}
}