From 5b03b345cbff865cb84ae2770bd250134eaa0f7e Mon Sep 17 00:00:00 2001 From: cxfksword <718792+cxfksword@users.noreply.github.com> Date: Fri, 17 Feb 2023 12:48:52 +0800 Subject: [PATCH] Remove unused code --- Jellyfin.Plugin.MetaShark/Plugin.cs | 31 +---------------------------- 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/Jellyfin.Plugin.MetaShark/Plugin.cs b/Jellyfin.Plugin.MetaShark/Plugin.cs index 1493519..48c9237 100644 --- a/Jellyfin.Plugin.MetaShark/Plugin.cs +++ b/Jellyfin.Plugin.MetaShark/Plugin.cs @@ -25,19 +25,15 @@ public class Plugin : BasePlugin, IHasWebPages /// public const string ProviderId = "MetaSharkID"; - protected readonly IHttpContextAccessor _httpContextAccessor; /// /// Initializes a new instance of the class. /// /// Instance of the interface. /// Instance of the interface. - /// /// Instance of the interface. - public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer, IHttpContextAccessor httpContextAccessor) + public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer) : base(applicationPaths, xmlSerializer) { - this._httpContextAccessor = httpContextAccessor; - Plugin.Instance = this; } @@ -64,29 +60,4 @@ public class Plugin : BasePlugin, IHasWebPages } }; } - - - /// - /// jellyfin web服务域名 - /// 注意:经过nginx代理后,会拿不到真正的域名,需要用户配置http服务传入真正host - /// - public string BaseUrl - { - get - { - if (_httpContextAccessor.HttpContext != null) - { - // // 使用web浏览器访问直接使用相对链接???可解决用户配置了http反代 - // var userAgent = _httpContextAccessor.HttpContext.Request.Headers.UserAgent.ToString(); - // var fromWeb = userAgent.Contains("Chrome") || userAgent.Contains("Safari"); - // if (fromWeb) return string.Empty; - - return _httpContextAccessor.HttpContext.Request.Scheme + System.Uri.SchemeDelimiter + _httpContextAccessor.HttpContext.Request.Host; - } - else - { - return string.Empty; - } - } - } }