Added better support for Jellyfin, we will now auto detect if it's a jellyfin server after pressing the discover button

This commit is contained in:
tidusjar 2019-10-12 21:29:02 +01:00
commit e5ef111087
15 changed files with 96 additions and 24 deletions

View file

@ -1,21 +1,21 @@
using System;
using System.Globalization;
using System.Collections.Generic;
using System.Text;
namespace Ombi.Helpers
namespace Ombi.Helpers
{
public class EmbyHelper
{
public static string GetEmbyMediaUrl(string mediaId, string customerServerUrl = null)
public static string GetEmbyMediaUrl(string mediaId, string customerServerUrl = null, bool isJellyfin = false)
{
string path = "item/item";
if (isJellyfin)
{
path = "itemdetails";
}
if (customerServerUrl.HasValue())
{
return $"{customerServerUrl}#!/item/item.html?id={mediaId}";
return $"{customerServerUrl}#!/{path}.html?id={mediaId}";
}
else
{
return $"https://app.emby.media/#!/item/item.html?id={mediaId}";
return $"https://app.emby.media/#!/{path}.html?id={mediaId}";
}
}
}