mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-15 17:52:57 -07:00
Made a start on supporting multiple emby servers, the UI needs rework #865
This commit is contained in:
parent
03add0ffc8
commit
b82dd4c529
7 changed files with 38 additions and 17 deletions
|
@ -35,6 +35,7 @@ using Ombi.Core.Rule.Interfaces;
|
||||||
using Ombi.Core.Senders;
|
using Ombi.Core.Senders;
|
||||||
using Ombi.Schedule.Ombi;
|
using Ombi.Schedule.Ombi;
|
||||||
using Ombi.Store.Repository.Requests;
|
using Ombi.Store.Repository.Requests;
|
||||||
|
using PlexContentCacher = Ombi.Schedule.Jobs.Plex.PlexContentCacher;
|
||||||
|
|
||||||
namespace Ombi.DependencyInjection
|
namespace Ombi.DependencyInjection
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,9 +38,9 @@ using Ombi.Helpers;
|
||||||
using Ombi.Store.Entities;
|
using Ombi.Store.Entities;
|
||||||
using Ombi.Store.Repository;
|
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)
|
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>();
|
var contentToAdd = new List<PlexContent>();
|
||||||
foreach (var content in allContent)
|
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
|
// Process Shows
|
||||||
foreach (var show in content.Metadata)
|
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)
|
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)
|
private List<Mediacontainer> GetAllContent(PlexServers plexSettings)
|
||||||
{
|
{
|
||||||
var sections = PlexApi.GetLibrarySections(plexSettings.PlexAuthToken, plexSettings.FullUri).Result;
|
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 bool Enable { get; set; }
|
||||||
|
public List<EmbyServers> Servers { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EmbyServers : ExternalSettings
|
||||||
|
{
|
||||||
public string ApiKey { get; set; }
|
public string ApiKey { get; set; }
|
||||||
public string AdministratorId { get; set; }
|
public string AdministratorId { get; set; }
|
||||||
public bool EnableEpisodeSearching { get; set; }
|
public bool EnableEpisodeSearching { get; set; }
|
||||||
|
|
|
@ -19,9 +19,13 @@ export interface IOmbiSettings extends ISettings {
|
||||||
allowExternalUsersToAuthenticate:boolean,
|
allowExternalUsersToAuthenticate:boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IEmbySettings extends IExternalSettings {
|
export interface IEmbySettings extends ISettings {
|
||||||
apiKey: string,
|
|
||||||
enable: boolean,
|
enable: boolean,
|
||||||
|
servers: IEmbyServer[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IEmbyServer extends IExternalSettings {
|
||||||
|
apiKey: string,
|
||||||
administratorId: string,
|
administratorId: string,
|
||||||
enableEpisodeSearching: boolean,
|
enableEpisodeSearching: boolean,
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
<settings-menu></settings-menu>
|
<settings-menu></settings-menu>
|
||||||
<div *ngIf="settings">
|
<div *ngIf="settings">
|
||||||
<fieldset>
|
<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="form-group">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<div class="checkbox">
|
<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>
|
<label for="enable">Enable</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -93,7 +93,7 @@
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="checkbox">
|
<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>
|
<label for="ssl">SSL</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -101,7 +101,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="checkbox">
|
<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>
|
<label for="EnableTvEpisodeSearching">Enable Episode Searching</label>
|
||||||
</div>
|
</div>
|
||||||
<small>
|
<small>
|
||||||
|
@ -136,7 +136,7 @@
|
||||||
<div *ngFor="let lib of server.plexSelectedLibraries">
|
<div *ngFor="let lib of server.plexSelectedLibraries">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="checkbox">
|
<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>
|
<label for="{{lib.title}}">{{lib.title}}</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Discord']">Discord</a></li>
|
<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/Slack']">Slack</a></li>
|
||||||
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Pushbullet']">Pushbullet</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>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -57,9 +57,9 @@
|
||||||
System <span class="caret"></span>
|
System <span class="caret"></span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Update']">Update</a></li>
|
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Update']">Update (Not available)</a></li>
|
||||||
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Logs']">Logs</a></li>
|
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Logs']">Logs (Not available)</a></li>
|
||||||
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/ScheduledJobs']">Scheduled Jobs</a></li>
|
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/ScheduledJobs']">Scheduled Jobs (Not available)</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue