mirror of
https://github.com/cxfksword/jellyfin-plugin-danmu.git
synced 2026-02-03 02:04:47 +08:00
chore: dandan is deprecated.
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="verticalSection verticalSection-extrabottompadding">
|
||||
<fieldset id="dandanSection" class="verticalSection verticalSection-extrabottompadding" style="display: none;">
|
||||
<legend>
|
||||
<h3>弹弹play配置</h3>
|
||||
</legend>
|
||||
@@ -166,6 +166,7 @@
|
||||
|
||||
$('#Scrapers').empty().append(html);
|
||||
setButtons();
|
||||
setDandan(config);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
@@ -224,6 +225,18 @@
|
||||
});
|
||||
}
|
||||
|
||||
function setDandan(config) {
|
||||
if (config.Scrapers) {
|
||||
for (var i = 0; i < config.Scrapers.length; i++) {
|
||||
if (config.Scrapers[i].Name === "弹弹play") {
|
||||
$('#dandanSection').show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#dandanSection').hide();
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
setButtons();
|
||||
$(document).on('click', '.btnViewItemDown', function (e) {
|
||||
|
||||
@@ -27,7 +27,7 @@ public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
|
||||
: base(applicationPaths, xmlSerializer)
|
||||
{
|
||||
Instance = this;
|
||||
Scrapers = applicationHost.GetExports<AbstractScraper>(false).Where(o => o != null).OrderBy(x => x.DefaultOrder).ToList().AsReadOnly();
|
||||
Scrapers = applicationHost.GetExports<AbstractScraper>(false).Where(o => o != null && !o.IsDeprecated).OrderBy(x => x.DefaultOrder).ToList().AsReadOnly();
|
||||
scraperManager.Register(Scrapers);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Net.Http;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using Jellyfin.Extensions.Json;
|
||||
using Jellyfin.Plugin.Danmu.Configuration;
|
||||
using Jellyfin.Plugin.Danmu.Core.Extensions;
|
||||
using Jellyfin.Plugin.Danmu.Core.Http;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
@@ -20,6 +21,13 @@ public abstract class AbstractApi : IDisposable
|
||||
protected CookieContainer _cookieContainer;
|
||||
protected IMemoryCache _memoryCache;
|
||||
|
||||
public PluginConfiguration Config
|
||||
{
|
||||
get
|
||||
{
|
||||
return Plugin.Instance?.Configuration ?? new Configuration.PluginConfiguration();
|
||||
}
|
||||
}
|
||||
|
||||
public AbstractApi(ILogger log)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Plugin.Danmu.Configuration;
|
||||
using Jellyfin.Plugin.Danmu.Scrapers.Entity;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -27,6 +28,20 @@ public abstract class AbstractScraper
|
||||
/// </summary>
|
||||
public abstract string ProviderId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否已废弃
|
||||
/// </summary>
|
||||
/// <returns>是否已废弃</returns>
|
||||
public virtual bool IsDeprecated => false;
|
||||
|
||||
public PluginConfiguration Config
|
||||
{
|
||||
get
|
||||
{
|
||||
return Plugin.Instance?.Configuration ?? new Configuration.PluginConfiguration();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public AbstractScraper(ILogger log)
|
||||
{
|
||||
|
||||
@@ -33,6 +33,8 @@ public class Dandan : AbstractScraper
|
||||
|
||||
public override string ProviderId => ScraperProviderId;
|
||||
|
||||
public override bool IsDeprecated => string.IsNullOrEmpty(this._api.ApiID) || string.IsNullOrEmpty(this._api.ApiSecret);
|
||||
|
||||
public override async Task<List<ScraperSearchInfo>> Search(BaseItem item)
|
||||
{
|
||||
var list = new List<ScraperSearchInfo>();
|
||||
|
||||
@@ -33,7 +33,7 @@ public class DandanApi : AbstractApi
|
||||
}
|
||||
}
|
||||
|
||||
protected string ApiID
|
||||
public string ApiID
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -47,7 +47,7 @@ public class DandanApi : AbstractApi
|
||||
}
|
||||
}
|
||||
|
||||
protected string ApiSecret
|
||||
public string ApiSecret
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
[](https://github.com/cxfksword/jellyfin-plugin-danmu/releases)
|
||||
[](https://github.com/cxfksword/jellyfin-plugin-danmu/main/LICENSE)
|
||||
|
||||
jellyfin弹幕自动下载插件,已支持的弹幕来源:b站,弹弹play,优酷,爱奇艺,腾讯视频,芒果TV。
|
||||
jellyfin弹幕自动下载插件,已支持的弹幕来源:b站,~~弹弹play~~,优酷,爱奇艺,腾讯视频,芒果TV。
|
||||
|
||||
支持功能:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user