Ombi/src/Ombi.Helpers/JellyfinHelper.cs
Joshua M. Boniface 9fe644f3db Add separate Jellyfin server type
Due to forthcoming changes to the Jellyfin API, this adds support for
Jellyfin as server type completely independent from Emby. It also undoes
the workarounds that treated Jellyfin as a subset of Emby.
2020-12-10 02:16:20 -05:00

27 lines
944 B
C#

namespace Ombi.Helpers
{
public static class JellyfinHelper
{
public static string GetJellyfinMediaUrl(string mediaId, string serverId, string customerServerUrl = null, bool isJellyfin = false)
{
//web/index.html#!/details|item
string path = "item";
if (isJellyfin)
{
path = "details";
}
if (customerServerUrl.HasValue())
{
if (!customerServerUrl.EndsWith("/"))
{
return $"{customerServerUrl}/web/index.html#!/{path}?id={mediaId}&serverId={serverId}";
}
return $"{customerServerUrl}web/index.html#!/{path}?id={mediaId}&serverId={serverId}";
}
else
{
return $"https://app.jellyfin.media/web/index.html#!/{path}?id={mediaId}&serverId={serverId}";
}
}
}
}