mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-12 08:16:05 -07:00
Fixed #3455
This commit is contained in:
parent
10430cfb40
commit
b09d4e41f9
2 changed files with 9 additions and 8 deletions
|
@ -25,9 +25,10 @@ namespace Ombi.Helpers.Tests
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var mediaId = 1;
|
var mediaId = 1;
|
||||||
yield return new TestCaseData(mediaId.ToString(), "http://google.com").Returns($"http://google.com/#!/item/item.html?id={mediaId}").SetName("EmbyHelper_GetMediaUrl_WithCustomDomain_WithoutTrailingSlash");
|
yield return new TestCaseData(mediaId.ToString(), "http://google.com").Returns($"http://google.com/#!/item?id={mediaId}").SetName("EmbyHelper_GetMediaUrl_WithCustomDomain_WithoutTrailingSlash");
|
||||||
yield return new TestCaseData(mediaId.ToString(), "http://google.com/").Returns($"http://google.com/#!/item/item.html?id={mediaId}").SetName("EmbyHelper_GetMediaUrl_WithCustomDomain");
|
yield return new TestCaseData(mediaId.ToString(), "http://google.com/").Returns($"http://google.com/#!/item?id={mediaId}").SetName("EmbyHelper_GetMediaUrl_WithCustomDomain");
|
||||||
yield return new TestCaseData(mediaId.ToString(), "https://google.com/").Returns($"https://google.com/#!/item/item.html?id={mediaId}").SetName("EmbyHelper_GetMediaUrl_WithCustomDomain_Https");
|
yield return new TestCaseData(mediaId.ToString(), "https://google.com/").Returns($"https://google.com/#!/item?id={mediaId}").SetName("EmbyHelper_GetMediaUrl_WithCustomDomain_Https");
|
||||||
|
yield return new TestCaseData(mediaId.ToString(), string.Empty).Returns($"https://app.emby.media/#!/item?id={mediaId}").SetName("EmbyHelper_GetMediaUrl_WithOutCustomDomain");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,22 +4,22 @@
|
||||||
{
|
{
|
||||||
public static string GetEmbyMediaUrl(string mediaId, string customerServerUrl = null, bool isJellyfin = false)
|
public static string GetEmbyMediaUrl(string mediaId, string customerServerUrl = null, bool isJellyfin = false)
|
||||||
{
|
{
|
||||||
string path = "item/item";
|
string path = "item";
|
||||||
if (isJellyfin)
|
if (isJellyfin)
|
||||||
{
|
{
|
||||||
path = "itemdetails";
|
path = "itemdetails.html";
|
||||||
}
|
}
|
||||||
if (customerServerUrl.HasValue())
|
if (customerServerUrl.HasValue())
|
||||||
{
|
{
|
||||||
if (!customerServerUrl.EndsWith("/"))
|
if (!customerServerUrl.EndsWith("/"))
|
||||||
{
|
{
|
||||||
return $"{customerServerUrl}/#!/{path}.html?id={mediaId}";
|
return $"{customerServerUrl}/#!/{path}?id={mediaId}";
|
||||||
}
|
}
|
||||||
return $"{customerServerUrl}#!/{path}.html?id={mediaId}";
|
return $"{customerServerUrl}#!/{path}?id={mediaId}";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $"https://app.emby.media/#!/{path}.html?id={mediaId}";
|
return $"https://app.emby.media/#!/{path}?id={mediaId}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue