using System.Net;
using System.Reflection;
using MediaBrowser.Model.Plugins;
namespace Jellyfin.Plugin.MetaShark.Configuration;
///
/// Plugin configuration.
///
public class PluginConfiguration : BasePluginConfiguration
{
public const int MAX_CAST_MEMBERS = 15;
public const int MAX_SEARCH_RESULT = 5;
///
/// 插件版本
///
public string Version { get; } = Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? string.Empty;
public string DoubanCookies { get; set; } = string.Empty;
///
/// 豆瓣开启防封禁
///
public bool EnableDoubanAvoidRiskControl { get; set; } = false;
///
/// 豆瓣海报使用大图
///
public bool EnableDoubanLargePoster { get; set; } = false;
///
/// 豆瓣背景图使用原图
///
public bool EnableDoubanBackdropRaw { get; set; } = false;
///
/// 豆瓣图片代理地址
///
public string DoubanImageProxyBaseUrl { get; set; } = string.Empty;
///
/// 启用获取tmdb元数据
///
public bool EnableTmdb { get; set; } = true;
///
/// 启用显示tmdb搜索结果
///
public bool EnableTmdbSearch { get; set; } = false;
///
/// 启用tmdb获取背景图
///
public bool EnableTmdbBackdrop { get; set; } = true;
///
/// 是否获取电影系列信息
///
public bool EnableTmdbCollection { get; set; } = true;
///
/// 是否获取tmdb分级信息
///
public bool EnableTmdbOfficialRating { get; set; } = true;
///
/// tmdb api key
///
public string TmdbApiKey { get; set; } = string.Empty;
///
/// tmdb api host
///
public string TmdbHost { get; set; } = string.Empty;
///
/// 代理服务器类型,0-禁用,1-http,2-https,3-socket5
///
public string TmdbProxyType { get; set; } = string.Empty;
///
/// 代理服务器host
///
public string TmdbProxyPort { get; set; } = string.Empty;
///
/// 代理服务器端口
///
public string TmdbProxyHost { get; set; } = string.Empty;
public IWebProxy GetTmdbWebProxy()
{
if (!string.IsNullOrEmpty(TmdbProxyType))
{
return new WebProxy($"{TmdbProxyType}://{TmdbProxyHost}:{TmdbProxyPort}", true);
}
return null;
}
}