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.
This commit is contained in:
Joshua M. Boniface 2020-12-10 01:33:55 -05:00
parent ce39f205f3
commit 9fe644f3db
116 changed files with 3672 additions and 103 deletions

View file

@ -0,0 +1,27 @@
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}";
}
}
}
}