Made a start on supporting multiple emby servers, the UI needs rework #865

pull/1488/head
Jamie.Rees 7 years ago
parent 03add0ffc8
commit b82dd4c529

@ -35,6 +35,7 @@ using Ombi.Core.Rule.Interfaces;
using Ombi.Core.Senders;
using Ombi.Schedule.Ombi;
using Ombi.Store.Repository.Requests;
using PlexContentCacher = Ombi.Schedule.Jobs.Plex.PlexContentCacher;
namespace Ombi.DependencyInjection
{

@ -38,9 +38,9 @@ using Ombi.Helpers;
using Ombi.Store.Entities;
using Ombi.Store.Repository;
namespace Ombi.Schedule.Jobs
namespace Ombi.Schedule.Jobs.Plex
{
public partial class PlexContentCacher : IPlexContentCacher
public class PlexContentCacher : IPlexContentCacher
{
public PlexContentCacher(ISettingsService<PlexSettings> plex, IPlexApi plexApi, ILogger<PlexContentCacher> logger, IPlexContentRepository repo)
{
@ -89,7 +89,7 @@ namespace Ombi.Schedule.Jobs
var contentToAdd = new List<PlexContent>();
foreach (var content in allContent)
{
if (content.viewGroup.Equals(PlexMediaType.Show.ToString(), StringComparison.CurrentCultureIgnoreCase))
if (content.viewGroup.Equals(Jobs.PlexContentCacher.PlexMediaType.Show.ToString(), StringComparison.CurrentCultureIgnoreCase))
{
// Process Shows
foreach (var show in content.Metadata)
@ -157,7 +157,7 @@ namespace Ombi.Schedule.Jobs
}
}
}
if (content.viewGroup.Equals(PlexMediaType.Movie.ToString(), StringComparison.CurrentCultureIgnoreCase))
if (content.viewGroup.Equals(Jobs.PlexContentCacher.PlexMediaType.Movie.ToString(), StringComparison.CurrentCultureIgnoreCase))
{
foreach (var movie in content.Metadata)
{
@ -198,6 +198,13 @@ namespace Ombi.Schedule.Jobs
}
}
/// <summary>
/// Gets all the library sections.
/// If the user has specified only certain libraries then we will only look for those
/// If they have not set the settings then we will monitor them all
/// </summary>
/// <param name="plexSettings">The plex settings.</param>
/// <returns></returns>
private List<Mediacontainer> GetAllContent(PlexServers plexSettings)
{
var sections = PlexApi.GetLibrarySections(plexSettings.PlexAuthToken, plexSettings.FullUri).Result;

@ -1,8 +1,15 @@
namespace Ombi.Core.Settings.Models.External
using System.Collections.Generic;
namespace Ombi.Core.Settings.Models.External
{
public sealed class EmbySettings : ExternalSettings
public sealed class EmbySettings : Ombi.Settings.Settings.Models.Settings
{
public bool Enable { get; set; }
public List<EmbyServers> Servers { get; set; }
}
public class EmbyServers : ExternalSettings
{
public string ApiKey { get; set; }
public string AdministratorId { get; set; }
public bool EnableEpisodeSearching { get; set; }

@ -19,9 +19,13 @@ export interface IOmbiSettings extends ISettings {
allowExternalUsersToAuthenticate:boolean,
}
export interface IEmbySettings extends IExternalSettings {
apiKey: string,
export interface IEmbySettings extends ISettings {
enable: boolean,
servers: IEmbyServer[]
}
export interface IEmbyServer extends IExternalSettings {
apiKey: string,
administratorId: string,
enableEpisodeSearching: boolean,
}

@ -2,7 +2,9 @@
<settings-menu></settings-menu>
<div *ngIf="settings">
<fieldset>
<legend>Emby Configuration</legend>
<legend>Emby Configuration
<b>(UNDER CONSTRUCTION <i class="fa fa-smile-o"></i>)</b>
</legend>
<div class="form-group">
<div class="checkbox">

@ -11,7 +11,7 @@
<div class="form-group col-md-3">
<div class="checkbox">
<input type="checkbox" id="enable" [(ngModel)]="settings.enable" ng-checked="settings.enable">
<input type="checkbox" id="enable" [(ngModel)]="settings.enable" [checked]="settings.enable">
<label for="enable">Enable</label>
</div>
</div>
@ -93,7 +93,7 @@
<div class="form-group">
<div class="checkbox">
<input type="checkbox" id="ssl" [(ngModel)]="server.ssl" ng-checked="server.ssl">
<input type="checkbox" id="ssl" [(ngModel)]="server.ssl" [checked]="server.ssl">
<label for="ssl">SSL</label>
</div>
</div>
@ -101,7 +101,7 @@
<div class="form-group">
<div class="checkbox">
<input type="checkbox" id="EnableTvEpisodeSearching" [(ngModel)]="server.enableEpisodeSearching" ng-checked="server.enableEpisodeSearching">
<input type="checkbox" id="EnableTvEpisodeSearching" [(ngModel)]="server.enableEpisodeSearching" [checked]="server.enableEpisodeSearching">
<label for="EnableTvEpisodeSearching">Enable Episode Searching</label>
</div>
<small>
@ -136,7 +136,7 @@
<div *ngFor="let lib of server.plexSelectedLibraries">
<div class="form-group">
<div class="checkbox">
<input type="checkbox" id="{{lib.title}}" [(ngModel)]="lib.enabled" ng-checked="lib.enabled">
<input type="checkbox" id="{{lib.title}}" [(ngModel)]="lib.enabled" [checked]="lib.enabled">
<label for="{{lib.title}}">{{lib.title}}</label>
</div>
</div>

@ -47,7 +47,7 @@
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Discord']">Discord</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Slack']">Slack</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Pushbullet']">Pushbullet</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Pushover']">Pushover</a></li>
<!--<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Pushover']">Pushover</a></li>-->
</ul>
</li>
@ -57,9 +57,9 @@
System <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Update']">Update</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Logs']">Logs</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/ScheduledJobs']">Scheduled Jobs</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Update']">Update (Not available)</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Logs']">Logs (Not available)</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/ScheduledJobs']">Scheduled Jobs (Not available)</a></li>
</ul>
</li>

Loading…
Cancel
Save