From 7f9652ba4eedfdf0b69d6af62f6d70a0b867b51f Mon Sep 17 00:00:00 2001 From: Jamie Rees Date: Mon, 2 Nov 2020 21:05:26 +0000 Subject: [PATCH] Fixed #3476 --- src/Ombi.Helpers.Tests/EmbyHelperTests.cs | 16 +++++++++------- src/Ombi.Helpers/EmbyHelper.cs | 9 +++++---- .../src/app/settings/emby/emby.component.html | 12 ++++++------ 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/Ombi.Helpers.Tests/EmbyHelperTests.cs b/src/Ombi.Helpers.Tests/EmbyHelperTests.cs index 62563e37e..261ba87cc 100644 --- a/src/Ombi.Helpers.Tests/EmbyHelperTests.cs +++ b/src/Ombi.Helpers.Tests/EmbyHelperTests.cs @@ -11,12 +11,14 @@ namespace Ombi.Helpers.Tests [TestCaseSource(nameof(UrlData))] public string TestUrl(string mediaId, string url, string serverId) { + // http://192.168.68.X:8096/web/index.html#!/item?id=17980&serverId=4e7a85e6ed0b49b9a6d6d15e739a566b return EmbyHelper.GetEmbyMediaUrl(mediaId, serverId, url); } [TestCaseSource(nameof(JellyfinUrlData))] public string TestJellyfinUrl(string mediaId, string url, string serverId) { + // http://192.168.68.X:8097/web/index.html#!/details?id=7ffe222498445d5ebfddb31bc4fa9a6d&serverId=50cce67f0baa425093d189b3017331fb return EmbyHelper.GetEmbyMediaUrl(mediaId, serverId, url, true); } @@ -25,10 +27,10 @@ namespace Ombi.Helpers.Tests get { var mediaId = 1; - yield return new TestCaseData(mediaId.ToString(), "http://google.com", "1").Returns($"http://google.com/#!/item?id={mediaId}&serverId=1").SetName("EmbyHelper_GetMediaUrl_WithCustomDomain_WithoutTrailingSlash"); - yield return new TestCaseData(mediaId.ToString(), "http://google.com/", "1").Returns($"http://google.com/#!/item?id={mediaId}&serverId=1").SetName("EmbyHelper_GetMediaUrl_WithCustomDomain"); - yield return new TestCaseData(mediaId.ToString(), "https://google.com/", "1").Returns($"https://google.com/#!/item?id={mediaId}&serverId=1").SetName("EmbyHelper_GetMediaUrl_WithCustomDomain_Https"); - yield return new TestCaseData(mediaId.ToString(), string.Empty, "1").Returns($"https://app.emby.media/#!/item?id={mediaId}&serverId=1").SetName("EmbyHelper_GetMediaUrl_WithOutCustomDomain"); + yield return new TestCaseData(mediaId.ToString(), "http://google.com", "1").Returns($"http://google.com/web/index.html#!/item?id={mediaId}&serverId=1").SetName("EmbyHelper_GetMediaUrl_WithCustomDomain_WithoutTrailingSlash"); + yield return new TestCaseData(mediaId.ToString(), "http://google.com/", "1").Returns($"http://google.com/web/index.html#!/item?id={mediaId}&serverId=1").SetName("EmbyHelper_GetMediaUrl_WithCustomDomain"); + yield return new TestCaseData(mediaId.ToString(), "https://google.com/", "1").Returns($"https://google.com/web/index.html#!/item?id={mediaId}&serverId=1").SetName("EmbyHelper_GetMediaUrl_WithCustomDomain_Https"); + yield return new TestCaseData(mediaId.ToString(), string.Empty, "1").Returns($"https://app.emby.media/web/index.html#!/item?id={mediaId}&serverId=1").SetName("EmbyHelper_GetMediaUrl_WithOutCustomDomain"); } } @@ -37,9 +39,9 @@ namespace Ombi.Helpers.Tests get { var mediaId = 1; - yield return new TestCaseData(mediaId.ToString(), "http://google.com", "1").Returns($"http://google.com/#!/itemdetails.html?id={mediaId}&serverId=1").SetName("EmbyHelperJellyfin_GetMediaUrl_WithCustomDomain_WithoutTrailingSlash"); - yield return new TestCaseData(mediaId.ToString(), "http://google.com/", "1").Returns($"http://google.com/#!/itemdetails.html?id={mediaId}&serverId=1").SetName("EmbyHelperJellyfin_GetMediaUrl_WithCustomDomain"); - yield return new TestCaseData(mediaId.ToString(), "https://google.com/", "1").Returns($"https://google.com/#!/itemdetails.html?id={mediaId}&serverId=1").SetName("EmbyHelperJellyfin_GetMediaUrl_WithCustomDomain_Https"); + yield return new TestCaseData(mediaId.ToString(), "http://google.com", "1").Returns($"http://google.com/web/index.html#!/details?id={mediaId}&serverId=1").SetName("EmbyHelperJellyfin_GetMediaUrl_WithCustomDomain_WithoutTrailingSlash"); + yield return new TestCaseData(mediaId.ToString(), "http://google.com/", "1").Returns($"http://google.com/web/index.html#!/details?id={mediaId}&serverId=1").SetName("EmbyHelperJellyfin_GetMediaUrl_WithCustomDomain"); + yield return new TestCaseData(mediaId.ToString(), "https://google.com/", "1").Returns($"https://google.com/web/index.html#!/details?id={mediaId}&serverId=1").SetName("EmbyHelperJellyfin_GetMediaUrl_WithCustomDomain_Https"); } } } diff --git a/src/Ombi.Helpers/EmbyHelper.cs b/src/Ombi.Helpers/EmbyHelper.cs index 7f30655fa..4d2bcfc57 100644 --- a/src/Ombi.Helpers/EmbyHelper.cs +++ b/src/Ombi.Helpers/EmbyHelper.cs @@ -4,22 +4,23 @@ { public static string GetEmbyMediaUrl(string mediaId, string serverId, string customerServerUrl = null, bool isJellyfin = false) { + //web/index.html#!/details|item string path = "item"; if (isJellyfin) { - path = "itemdetails.html"; + path = "details"; } if (customerServerUrl.HasValue()) { if (!customerServerUrl.EndsWith("/")) { - return $"{customerServerUrl}/#!/{path}?id={mediaId}&serverId={serverId}"; + return $"{customerServerUrl}/web/index.html#!/{path}?id={mediaId}&serverId={serverId}"; } - return $"{customerServerUrl}#!/{path}?id={mediaId}&serverId={serverId}"; + return $"{customerServerUrl}web/index.html#!/{path}?id={mediaId}&serverId={serverId}"; } else { - return $"https://app.emby.media/#!/{path}?id={mediaId}&serverId={serverId}"; + return $"https://app.emby.media/web/index.html#!/{path}?id={mediaId}&serverId={serverId}"; } } } diff --git a/src/Ombi/ClientApp/src/app/settings/emby/emby.component.html b/src/Ombi/ClientApp/src/app/settings/emby/emby.component.html index 6ebfc5aaf..e6d35b1c1 100644 --- a/src/Ombi/ClientApp/src/app/settings/emby/emby.component.html +++ b/src/Ombi/ClientApp/src/app/settings/emby/emby.component.html @@ -30,12 +30,6 @@ -
- - Server ID - - -
@@ -43,6 +37,12 @@ +
+ + Server ID + + +
Port