mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
Remove remaining IsJellyfin sections
This commit is contained in:
parent
f8b9b3ca25
commit
6a96d6718b
17 changed files with 24 additions and 46 deletions
|
@ -5,7 +5,6 @@
|
||||||
public string LocalAddress { get; set; }
|
public string LocalAddress { get; set; }
|
||||||
public string ServerName { get; set; }
|
public string ServerName { get; set; }
|
||||||
public string Version { get; set; }
|
public string Version { get; set; }
|
||||||
|
|
||||||
public string OperatingSystem { get; set; }
|
public string OperatingSystem { get; set; }
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,15 +5,8 @@
|
||||||
public string LocalAddress { get; set; }
|
public string LocalAddress { get; set; }
|
||||||
public string ServerName { get; set; }
|
public string ServerName { get; set; }
|
||||||
public string Version { 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 OperatingSystem { get; set; }
|
||||||
public string Id { 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);
|
var server = s.Servers.FirstOrDefault(x => x.ServerHostname != null);
|
||||||
if ((server?.ServerHostname ?? string.Empty).HasValue())
|
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
|
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();
|
return Success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,11 +70,11 @@ namespace Ombi.Core.Rule.Rules.Search
|
||||||
var server = s.Servers.FirstOrDefault(x => x.ServerHostname != null);
|
var server = s.Servers.FirstOrDefault(x => x.ServerHostname != null);
|
||||||
if ((server?.ServerHostname ?? string.Empty).HasValue())
|
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
|
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 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
|
//web/index.html#!/details|item
|
||||||
string path = "item";
|
string path = "item";
|
||||||
if (isJellyfin)
|
|
||||||
{
|
|
||||||
path = "details";
|
|
||||||
}
|
|
||||||
if (customerServerUrl.HasValue())
|
if (customerServerUrl.HasValue())
|
||||||
{
|
{
|
||||||
if (!customerServerUrl.EndsWith("/"))
|
if (!customerServerUrl.EndsWith("/"))
|
||||||
|
|
|
@ -2,14 +2,10 @@
|
||||||
{
|
{
|
||||||
public static class JellyfinHelper
|
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
|
//web/index.html#!/details|item
|
||||||
string path = "item";
|
string path = "details";
|
||||||
if (isJellyfin)
|
|
||||||
{
|
|
||||||
path = "details";
|
|
||||||
}
|
|
||||||
if (customerServerUrl.HasValue())
|
if (customerServerUrl.HasValue())
|
||||||
{
|
{
|
||||||
if (!customerServerUrl.EndsWith("/"))
|
if (!customerServerUrl.EndsWith("/"))
|
||||||
|
@ -20,7 +16,7 @@
|
||||||
}
|
}
|
||||||
else
|
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)
|
await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
|
||||||
.SendAsync(NotificationHub.NotificationEvent, "Emby Content Sync Failed");
|
.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,
|
Title = tvShow.Name,
|
||||||
Type = EmbyMediaType.Series,
|
Type = EmbyMediaType.Series,
|
||||||
EmbyId = tvShow.Id,
|
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
|
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);
|
Api = _apiFactory.CreateClient(settings);
|
||||||
|
|
||||||
await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
|
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();
|
var allUsers = await _userManager.Users.Where(x => x.UserType == UserType.EmbyUser || x.UserType == UserType.EmbyConnectUser).ToListAsync();
|
||||||
foreach (var server in settings.Servers)
|
foreach (var server in settings.Servers)
|
||||||
{
|
{
|
||||||
|
@ -180,4 +180,4 @@ namespace Ombi.Schedule.Jobs.Emby
|
||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace Ombi.Schedule.Jobs.Jellyfin
|
||||||
{
|
{
|
||||||
await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
|
await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
|
||||||
.SendAsync(NotificationHub.NotificationEvent, "Jellyfin Content Sync Failed");
|
.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,
|
Title = tvShow.Name,
|
||||||
Type = JellyfinMediaType.Series,
|
Type = JellyfinMediaType.Series,
|
||||||
JellyfinId = tvShow.Id,
|
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
|
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);
|
Api = _apiFactory.CreateClient(settings);
|
||||||
|
|
||||||
await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
|
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();
|
var allUsers = await _userManager.Users.Where(x => x.UserType == UserType.JellyfinUser).ToListAsync();
|
||||||
foreach (var server in settings.Servers)
|
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 sealed class EmbySettings : Ombi.Settings.Settings.Models.Settings
|
||||||
{
|
{
|
||||||
public bool Enable { get; set; }
|
public bool Enable { get; set; }
|
||||||
public bool IsJellyfin { get; set; }
|
|
||||||
public List<EmbyServers> Servers { get; set; } = new List<EmbyServers>();
|
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 string ServerHostname { get; set; }
|
||||||
public bool EnableEpisodeSearching { 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 sealed class JellyfinSettings : Ombi.Settings.Settings.Models.Settings
|
||||||
{
|
{
|
||||||
public bool Enable { get; set; }
|
public bool Enable { get; set; }
|
||||||
public bool IsJellyfin { get; set; }
|
|
||||||
public List<JellyfinServers> Servers { get; set; } = new List<JellyfinServers>();
|
public List<JellyfinServers> Servers { get; set; } = new List<JellyfinServers>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,6 @@ export interface IUpdateSettings extends ISettings {
|
||||||
|
|
||||||
export interface IEmbySettings extends ISettings {
|
export interface IEmbySettings extends ISettings {
|
||||||
enable: boolean;
|
enable: boolean;
|
||||||
isJellyfin: boolean;
|
|
||||||
servers: IEmbyServer[];
|
servers: IEmbyServer[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +55,6 @@ export interface IPublicInfo {
|
||||||
|
|
||||||
export interface IJellyfinSettings extends ISettings {
|
export interface IJellyfinSettings extends ISettings {
|
||||||
enable: boolean;
|
enable: boolean;
|
||||||
isJellyfin: boolean;
|
|
||||||
servers: IJellyfinServer[];
|
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">
|
<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>
|
</mat-form-field>
|
||||||
<small>
|
<small>
|
||||||
<span *ngIf="server.serverHostname">Current URL: "{{server.serverHostname}}/#!/{{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/#!/{{settings.isJellyfin ? ("itemdetails"): ("item/item")}}.html?id=1</span>
|
<span *ngIf="!server.serverHostname">Current URL: "https://app.emby.media/#!/item/item.html?id=1</span>
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</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">
|
<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>
|
</mat-form-field>
|
||||||
<small>
|
<small>
|
||||||
<span *ngIf="server.serverHostname">Current URL: "{{server.serverHostname}}/#!/{{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/#!/{{settings.isJellyfin ? ("itemdetails"): ("item/item")}}.html?id=1</span>
|
<span *ngIf="!server.serverHostname">Current URL: "https://app.jellyfin.media/#!/itemdetails.html?id=1</span>
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ export class EmbyComponent implements OnInit {
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
this.embySettings = {
|
this.embySettings = {
|
||||||
servers: [],
|
servers: [],
|
||||||
isJellyfin: false,
|
|
||||||
id: 0,
|
id: 0,
|
||||||
enable: true,
|
enable: true,
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,7 +20,6 @@ export class JellyfinComponent implements OnInit {
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
this.jellyfinSettings = {
|
this.jellyfinSettings = {
|
||||||
servers: [],
|
servers: [],
|
||||||
isJellyfin: false,
|
|
||||||
id: 0,
|
id: 0,
|
||||||
enable: true,
|
enable: true,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue