Remove remaining IsJellyfin sections

pull/3924/head
Joshua M. Boniface 4 years ago
parent f8b9b3ca25
commit 6a96d6718b

@ -5,7 +5,6 @@
public string LocalAddress { get; set; }
public string ServerName { get; set; }
public string Version { get; set; }
public string OperatingSystem { get; set; }
public string Id { get; set; }
}

@ -5,15 +5,8 @@
public string LocalAddress { get; set; }
public string ServerName { get; set; }
public string Version { get; set; }
/// <summary>
/// Only populated for Jellyfin
/// </summary>
public string ProductName { get; set; }
public bool IsJellyfin => !string.IsNullOrEmpty(ProductName) && ProductName.Contains("Jellyfin");
public string OperatingSystem { get; set; }
public string Id { get; set; }
}
}
}

@ -70,11 +70,11 @@ namespace Ombi.Core.Rule.Rules.Search
var server = s.Servers.FirstOrDefault(x => x.ServerHostname != null);
if ((server?.ServerHostname ?? string.Empty).HasValue())
{
obj.EmbyUrl = EmbyHelper.GetEmbyMediaUrl(item.EmbyId, server?.ServerId, server?.ServerHostname, s.IsJellyfin);
obj.EmbyUrl = EmbyHelper.GetEmbyMediaUrl(item.EmbyId, server?.ServerId, server?.ServerHostname);
}
else
{
obj.EmbyUrl = EmbyHelper.GetEmbyMediaUrl(item.EmbyId, server?.ServerId, null, s.IsJellyfin);
obj.EmbyUrl = EmbyHelper.GetEmbyMediaUrl(item.EmbyId, server?.ServerId, null);
}
}
@ -100,4 +100,4 @@ namespace Ombi.Core.Rule.Rules.Search
return Success();
}
}
}
}

@ -70,11 +70,11 @@ namespace Ombi.Core.Rule.Rules.Search
var server = s.Servers.FirstOrDefault(x => x.ServerHostname != null);
if ((server?.ServerHostname ?? string.Empty).HasValue())
{
obj.JellyfinUrl = JellyfinHelper.GetJellyfinMediaUrl(item.JellyfinId, server?.ServerId, server?.ServerHostname, s.IsJellyfin);
obj.JellyfinUrl = JellyfinHelper.GetJellyfinMediaUrl(item.JellyfinId, server?.ServerId, server?.ServerHostname);
}
else
{
obj.JellyfinUrl = JellyfinHelper.GetJellyfinMediaUrl(item.JellyfinId, server?.ServerId, null, s.IsJellyfin);
obj.JellyfinUrl = JellyfinHelper.GetJellyfinMediaUrl(item.JellyfinId, server?.ServerId, null);
}
}

@ -2,14 +2,10 @@
{
public static class EmbyHelper
{
public static string GetEmbyMediaUrl(string mediaId, string serverId, string customerServerUrl = null, bool isJellyfin = false)
public static string GetEmbyMediaUrl(string mediaId, string serverId, string customerServerUrl = null)
{
//web/index.html#!/details|item
string path = "item";
if (isJellyfin)
{
path = "details";
}
if (customerServerUrl.HasValue())
{
if (!customerServerUrl.EndsWith("/"))

@ -2,14 +2,10 @@
{
public static class JellyfinHelper
{
public static string GetJellyfinMediaUrl(string mediaId, string serverId, string customerServerUrl = null, bool isJellyfin = false)
public static string GetJellyfinMediaUrl(string mediaId, string serverId, string customerServerUrl = null)
{
//web/index.html#!/details|item
string path = "item";
if (isJellyfin)
{
path = "details";
}
string path = "details";
if (customerServerUrl.HasValue())
{
if (!customerServerUrl.EndsWith("/"))
@ -20,7 +16,7 @@
}
else
{
return $"https://app.jellyfin.media/web/index.html#!/{path}?id={mediaId}&serverId={serverId}";
return $"http://localhost:8096/web/index.html#!/{path}?id={mediaId}&serverId={serverId}";
}
}
}

@ -58,7 +58,7 @@ namespace Ombi.Schedule.Jobs.Emby
{
await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
.SendAsync(NotificationHub.NotificationEvent, "Emby Content Sync Failed");
_logger.LogError(e, "Exception when caching {1} for server {0}", server.Name, embySettings.IsJellyfin ? "Jellyfin" : "Emby");
_logger.LogError(e, "Exception when caching Emby for server {0}", server.Name);
}
}
@ -145,7 +145,7 @@ namespace Ombi.Schedule.Jobs.Emby
Title = tvShow.Name,
Type = EmbyMediaType.Series,
EmbyId = tvShow.Id,
Url = EmbyHelper.GetEmbyMediaUrl(tvShow.Id, server?.ServerId, server.ServerHostname, settings.IsJellyfin),
Url = EmbyHelper.GetEmbyMediaUrl(tvShow.Id, server?.ServerId, server.ServerHostname),
AddedAt = DateTime.UtcNow
});
}
@ -228,4 +228,4 @@ namespace Ombi.Schedule.Jobs.Emby
}
}
}
}

@ -80,7 +80,7 @@ namespace Ombi.Schedule.Jobs.Emby
Api = _apiFactory.CreateClient(settings);
await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
.SendAsync(NotificationHub.NotificationEvent, $"{(settings.IsJellyfin ? "Jellyfin" : "Emby")} User Importer Started");
.SendAsync(NotificationHub.NotificationEvent, $"Emby User Importer Started");
var allUsers = await _userManager.Users.Where(x => x.UserType == UserType.EmbyUser || x.UserType == UserType.EmbyConnectUser).ToListAsync();
foreach (var server in settings.Servers)
{
@ -180,4 +180,4 @@ namespace Ombi.Schedule.Jobs.Emby
GC.SuppressFinalize(this);
}
}
}
}

@ -58,7 +58,7 @@ namespace Ombi.Schedule.Jobs.Jellyfin
{
await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
.SendAsync(NotificationHub.NotificationEvent, "Jellyfin Content Sync Failed");
_logger.LogError(e, "Exception when caching {1} for server {0}", server.Name, jellyfinSettings.IsJellyfin ? "Jellyfin" : "Jellyfin");
_logger.LogError(e, "Exception when caching Jellyfin for server {0}", server.Name);
}
}
@ -145,7 +145,7 @@ namespace Ombi.Schedule.Jobs.Jellyfin
Title = tvShow.Name,
Type = JellyfinMediaType.Series,
JellyfinId = tvShow.Id,
Url = JellyfinHelper.GetJellyfinMediaUrl(tvShow.Id, server?.ServerId, server.ServerHostname, settings.IsJellyfin),
Url = JellyfinHelper.GetJellyfinMediaUrl(tvShow.Id, server?.ServerId, server.ServerHostname),
AddedAt = DateTime.UtcNow
});
}
@ -228,4 +228,4 @@ namespace Ombi.Schedule.Jobs.Jellyfin
}
}
}
}

@ -80,7 +80,7 @@ namespace Ombi.Schedule.Jobs.Jellyfin
Api = _apiFactory.CreateClient(settings);
await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
.SendAsync(NotificationHub.NotificationEvent, $"{(settings.IsJellyfin ? "Jellyfin" : "Jellyfin")} User Importer Started");
.SendAsync(NotificationHub.NotificationEvent, $"Jellyfin User Importer Started");
var allUsers = await _userManager.Users.Where(x => x.UserType == UserType.JellyfinUser).ToListAsync();
foreach (var server in settings.Servers)
{

@ -6,7 +6,6 @@ namespace Ombi.Core.Settings.Models.External
public sealed class EmbySettings : Ombi.Settings.Settings.Models.Settings
{
public bool Enable { get; set; }
public bool IsJellyfin { get; set; }
public List<EmbyServers> Servers { get; set; } = new List<EmbyServers>();
}
@ -19,4 +18,4 @@ namespace Ombi.Core.Settings.Models.External
public string ServerHostname { get; set; }
public bool EnableEpisodeSearching { get; set; }
}
}
}

@ -6,7 +6,6 @@ namespace Ombi.Core.Settings.Models.External
public sealed class JellyfinSettings : Ombi.Settings.Settings.Models.Settings
{
public bool Enable { get; set; }
public bool IsJellyfin { get; set; }
public List<JellyfinServers> Servers { get; set; } = new List<JellyfinServers>();
}

@ -36,7 +36,6 @@ export interface IUpdateSettings extends ISettings {
export interface IEmbySettings extends ISettings {
enable: boolean;
isJellyfin: boolean;
servers: IEmbyServer[];
}
@ -56,7 +55,6 @@ export interface IPublicInfo {
export interface IJellyfinSettings extends ISettings {
enable: boolean;
isJellyfin: boolean;
servers: IJellyfinServer[];
}

@ -70,8 +70,8 @@
<input matInput placeholder="e.g. https://jellyfin.server.com/" [(ngModel)]="server.serverHostname" value="{{server.serverHostname}}" matTooltip="This will be the external address that users will navigate to when they press the 'View On Emby' button">
</mat-form-field>
<small>
<span *ngIf="server.serverHostname">Current URL: "{{server.serverHostname}}/#!/{{settings.isJellyfin ? ("itemdetails"): ("item/item")}}.html?id=1"</span>
<span *ngIf="!server.serverHostname">Current URL: "https://app.emby.media/#!/{{settings.isJellyfin ? ("itemdetails"): ("item/item")}}.html?id=1</span>
<span *ngIf="server.serverHostname">Current URL: "{{server.serverHostname}}/#!/item/item.html?id=1"</span>
<span *ngIf="!server.serverHostname">Current URL: "https://app.emby.media/#!/item/item.html?id=1</span>
</small>
</div>

@ -70,8 +70,8 @@
<input matInput placeholder="e.g. https://jellyfin.server.com/" [(ngModel)]="server.serverHostname" value="{{server.serverHostname}}" matTooltip="This will be the external address that users will navigate to when they press the 'View On Jellyfin' button">
</mat-form-field>
<small>
<span *ngIf="server.serverHostname">Current URL: "{{server.serverHostname}}/#!/{{settings.isJellyfin ? ("itemdetails"): ("item/item")}}.html?id=1"</span>
<span *ngIf="!server.serverHostname">Current URL: "https://app.jellyfin.media/#!/{{settings.isJellyfin ? ("itemdetails"): ("item/item")}}.html?id=1</span>
<span *ngIf="server.serverHostname">Current URL: "{{server.serverHostname}}/#!/itemdetails.html?id=1"</span>
<span *ngIf="!server.serverHostname">Current URL: "https://app.jellyfin.media/#!/itemdetails.html?id=1</span>
</small>
</div>

@ -20,7 +20,6 @@ export class EmbyComponent implements OnInit {
public ngOnInit() {
this.embySettings = {
servers: [],
isJellyfin: false,
id: 0,
enable: true,
};

@ -20,7 +20,6 @@ export class JellyfinComponent implements OnInit {
public ngOnInit() {
this.jellyfinSettings = {
servers: [],
isJellyfin: false,
id: 0,
enable: true,
};

Loading…
Cancel
Save