mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
Allow us to use Emby as a media server
This commit is contained in:
parent
b8f20cc187
commit
60673a2459
4 changed files with 50 additions and 28 deletions
|
@ -1,9 +1,7 @@
|
||||||
{
|
{
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"Ombi.Updater": {
|
"Ombi.Updater": {
|
||||||
"commandName": "Project",
|
"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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,30 +1,32 @@
|
||||||
|
|
||||||
<h4 class="media-heading landing-title">Emby Authentication</h4>
|
<h4 class="media-heading landing-title">Emby Authentication</h4>
|
||||||
<div class="form-group" *ngIf="embySettings">
|
<div *ngIf="embySettings">
|
||||||
<label for="Ip" class="control-label">Emby Hostname or IP Address</label>
|
<div class="form-group">
|
||||||
<div>
|
<label for="Ip" class="control-label">Emby Hostname or IP Address</label>
|
||||||
<input type="text" [(ngModel)]="embySettings.ip" class="form-control form-control-custom " id="Ip" name="Ip" placeholder="192.168.1.1">
|
<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>
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="portNumber" class="control-label">Port</label>
|
<label for="portNumber" class="control-label">Port</label>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<input type="text" [(ngModel)]="embySettings.port" class="form-control form-control-custom " id="portNumber" name="Port" value="{{embySettings.port}}">
|
<input type="text" [(ngModel)]="embySettings.port" class="form-control form-control-custom " id="portNumber" name="Port" value="{{embySettings.port}}">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<div class="form-group">
|
<div class="checkbox">
|
||||||
<div class="checkbox">
|
<input type="checkbox" [(ngModel)]="embySettings.ssl" id="Ssl" name="Ssl"><label for="Ssl">SSL</label>
|
||||||
<input type="checkbox" [(ngModel)]="embySettings.ssl" id="Ssl" name="Ssl"><label for="Ssl">SSL</label>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<div class="form-group">
|
<label for="username" class="control-label">Api Key</label>
|
||||||
<label for="username" class="control-label">Api Key</label>
|
<div>
|
||||||
<div>
|
<input type="text" [(ngModel)]="embySettings.apiKey" class="form-control form-control-custom" id="apiKey" name="ApiKey" placeholder="ApiKey">
|
||||||
<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>
|
|
||||||
<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>
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { EmbyService } from '../../services/applications/emby.service';
|
import { EmbyService } from '../../services/applications/emby.service';
|
||||||
|
@ -10,13 +10,27 @@ import { IEmbySettings } from '../../interfaces/ISettings';
|
||||||
|
|
||||||
templateUrl: './emby.component.html',
|
templateUrl: './emby.component.html',
|
||||||
})
|
})
|
||||||
export class EmbyComponent {
|
export class EmbyComponent implements OnInit {
|
||||||
|
|
||||||
constructor(private embyService: EmbyService,
|
constructor(private embyService: EmbyService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private notificationService: NotificationService) {
|
private notificationService: NotificationService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.embySettings = {
|
||||||
|
administratorId: "",
|
||||||
|
apiKey: "",
|
||||||
|
enable: true,
|
||||||
|
enableEpisodeSearching: true,
|
||||||
|
id: 0,
|
||||||
|
ip: "",
|
||||||
|
port: 8096,
|
||||||
|
ssl: false,
|
||||||
|
subDir:""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private embySettings: IEmbySettings;
|
private embySettings: IEmbySettings;
|
||||||
|
|
||||||
|
|
||||||
|
|
12
src/Ombi/Controllers/External/EmbyController.cs
vendored
12
src/Ombi/Controllers/External/EmbyController.cs
vendored
|
@ -9,9 +9,17 @@ using Ombi.Core.Settings.Models.External;
|
||||||
|
|
||||||
namespace Ombi.Controllers.External
|
namespace Ombi.Controllers.External
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
[Admin]
|
[Admin]
|
||||||
public class EmbyController : BaseV1ApiController
|
public class EmbyController : BaseV1ApiController
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="emby"></param>
|
||||||
|
/// <param name="embySettings"></param>
|
||||||
public EmbyController(IEmbyApi emby, ISettingsService<EmbySettings> embySettings)
|
public EmbyController(IEmbyApi emby, ISettingsService<EmbySettings> embySettings)
|
||||||
{
|
{
|
||||||
EmbyApi = emby;
|
EmbyApi = emby;
|
||||||
|
@ -30,9 +38,9 @@ namespace Ombi.Controllers.External
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<EmbySettings> SignIn([FromBody] EmbySettings request)
|
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();
|
var settings = await EmbySettings.GetSettingsAsync();
|
||||||
if (settings != null && !string.IsNullOrEmpty(settings.ApiKey)) return null;
|
if (!string.IsNullOrEmpty(settings?.ApiKey)) return null;
|
||||||
|
|
||||||
request.Enable = true;
|
request.Enable = true;
|
||||||
// Test that we can connect
|
// Test that we can connect
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue