jellyfin-plugin-metashark/Jellyfin.Plugin.MetaShark/Configuration/PluginConfiguration.cs

90 lines
2.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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