Allow us to use Emby as a media server

pull/1488/head
tidusjar 8 years ago
parent b8f20cc187
commit 60673a2459

@ -1,9 +1,7 @@
{
"profiles": {
"Ombi.Updater": {
"commandName": "Project",
"commandLineArgs": "C:\\Users\\Jamie.Rees\\Source\\Repos\\PlexRequests.Net\\src\\Ombi\\bin\\Debug\\netcoreapp1.1",
"workingDirectory": "C:\\Users\\Jamie.Rees\\Source\\Repos\\PlexRequests.Net\\src\\Ombi\\bin\\Debug\\netcoreapp1.1\\UpdateTemp"
"commandName": "Project"
}
}
}

@ -1,30 +1,32 @@

<h4 class="media-heading landing-title">Emby Authentication</h4>
<div class="form-group" *ngIf="embySettings">
<label for="Ip" class="control-label">Emby Hostname or IP Address</label>
<div>
<input type="text" [(ngModel)]="embySettings.ip" class="form-control form-control-custom " id="Ip" name="Ip" placeholder="192.168.1.1">
<div *ngIf="embySettings">
<div class="form-group">
<label for="Ip" class="control-label">Emby Hostname or IP Address</label>
<div>
<input type="text" [(ngModel)]="embySettings.ip" class="form-control form-control-custom " id="Ip" name="Ip" placeholder="192.168.1.1">
</div>
</div>
</div>
<div class="form-group">
<label for="portNumber" class="control-label">Port</label>
<div class="form-group">
<label for="portNumber" class="control-label">Port</label>
<div>
<input type="text" [(ngModel)]="embySettings.port" class="form-control form-control-custom " id="portNumber" name="Port" value="{{embySettings.port}}">
<div>
<input type="text" [(ngModel)]="embySettings.port" class="form-control form-control-custom " id="portNumber" name="Port" value="{{embySettings.port}}">
</div>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<input type="checkbox" [(ngModel)]="embySettings.ssl" id="Ssl" name="Ssl"><label for="Ssl">SSL</label>
<div class="form-group">
<div class="checkbox">
<input type="checkbox" [(ngModel)]="embySettings.ssl" id="Ssl" name="Ssl"><label for="Ssl">SSL</label>
</div>
</div>
</div>
<div class="form-group">
<label for="username" class="control-label">Api Key</label>
<div>
<input type="text" [(ngModel)]="embySettings.apiKey" class="form-control form-control-custom" id="apiKey" name="ApiKey" placeholder="ApiKey">
<div class="form-group">
<label for="username" class="control-label">Api Key</label>
<div>
<input type="text" [(ngModel)]="embySettings.apiKey" class="form-control form-control-custom" id="apiKey" name="ApiKey" placeholder="ApiKey">
</div>
</div>
<div style="text-align: center; margin-top: 20px">
<a (click)="save()" id="embyApiKeySave" class="btn btn-primary-outline">Next <div id="spinner"></div></a>
</div>
</div>
<div style="text-align: center; margin-top: 20px">
<a (click)="save()" id="embyApiKeySave" class="btn btn-primary-outline">Next <div id="spinner"></div></a>
</div>

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { EmbyService } from '../../services/applications/emby.service';
@ -10,13 +10,27 @@ import { IEmbySettings } from '../../interfaces/ISettings';
templateUrl: './emby.component.html',
})
export class EmbyComponent {
export class EmbyComponent implements OnInit {
constructor(private embyService: EmbyService,
private router: Router,
private notificationService: NotificationService) {
}
ngOnInit(): void {
this.embySettings = {
administratorId: "",
apiKey: "",
enable: true,
enableEpisodeSearching: true,
id: 0,
ip: "",
port: 8096,
ssl: false,
subDir:""
}
}
private embySettings: IEmbySettings;

@ -9,9 +9,17 @@ using Ombi.Core.Settings.Models.External;
namespace Ombi.Controllers.External
{
/// <summary>
///
/// </summary>
[Admin]
public class EmbyController : BaseV1ApiController
{
/// <summary>
///
/// </summary>
/// <param name="emby"></param>
/// <param name="embySettings"></param>
public EmbyController(IEmbyApi emby, ISettingsService<EmbySettings> embySettings)
{
EmbyApi = emby;
@ -30,9 +38,9 @@ namespace Ombi.Controllers.External
[AllowAnonymous]
public async Task<EmbySettings> SignIn([FromBody] EmbySettings request)
{
// Check if settings exist
// Check if settings exist since we allow anon...
var settings = await EmbySettings.GetSettingsAsync();
if (settings != null && !string.IsNullOrEmpty(settings.ApiKey)) return null;
if (!string.IsNullOrEmpty(settings?.ApiKey)) return null;
request.Enable = true;
// Test that we can connect

Loading…
Cancel
Save