From 20c4b1ab78c1ec89591ae458e122862eef19bbba Mon Sep 17 00:00:00 2001 From: thsrite Date: Wed, 20 Aug 2025 16:09:10 +0800 Subject: [PATCH] =?UTF-8?q?fix=20Emby=E5=BC=B9=E5=B9=95=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=20v1.7=20=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=A6=81=E7=94=A8=E5=AA=92=E4=BD=93=E5=BA=93danmu?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=BC=80=E5=85=B3=EF=BC=88=E9=BB=98=E8=AE=A4?= =?UTF-8?q?False=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.v2.json | 3 ++- plugins.v2/embydanmu/__init__.py | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/package.v2.json b/package.v2.json index 4ae7d04..99a9b21 100644 --- a/package.v2.json +++ b/package.v2.json @@ -135,11 +135,12 @@ "name": "Emby弹幕下载", "description": "通知Emby Danmu插件下载弹幕。", "labels": "Emby,媒体库", - "version": "1.6", + "version": "1.7", "icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/danmu.png", "author": "thsrite", "level": 1, "history": { + "v1.7": "增加是否自动禁用媒体库danmu插件开关(默认False)", "v1.6": "增加Emby、MoviePilot目录映射(相同可不填)", "v1.5.1": "Emby4.8.8 Items API修改", "v1.5": "修复获取弹幕源", diff --git a/plugins.v2/embydanmu/__init__.py b/plugins.v2/embydanmu/__init__.py index 1cb7f6e..7cb11a8 100644 --- a/plugins.v2/embydanmu/__init__.py +++ b/plugins.v2/embydanmu/__init__.py @@ -20,7 +20,7 @@ class EmbyDanmu(_PluginBase): # 插件图标 plugin_icon = "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/danmu.png" # 插件版本 - plugin_version = "1.6" + plugin_version = "1.7" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -34,6 +34,7 @@ class EmbyDanmu(_PluginBase): # 私有属性 _enabled = False + _disabled = False _library_task = {} _danmu_source = [] _mediaservers = None @@ -52,6 +53,7 @@ class EmbyDanmu(_PluginBase): # 读取配置 if config: self._enabled = config.get("enabled") + self._disabled = config.get("disabled") self._dirs = config.get("dirs") self._mediaservers = config.get("mediaservers") or [] @@ -425,7 +427,7 @@ class EmbyDanmu(_PluginBase): # 判断当前媒体库是否有其他任务在执行 self._library_task[library_id].remove(library_item_name) - if len(self._library_task[library_id]) == 0: + if len(self._library_task[library_id]) == 0 and self._disabled: # 关闭弹幕插件 logger.info( f"{emby_name} {library_name} {library_item_name} {f'第{library_item_season}季 ' if library_item_season else ''}获取弹幕任务完成,关闭弹幕插件") @@ -761,6 +763,22 @@ class EmbyDanmu(_PluginBase): } } ] + }, + { + 'component': 'VCol', + 'props': { + 'cols': 12, + 'md': 6 + }, + 'content': [ + { + 'component': 'VSwitch', + 'props': { + 'model': 'disabled', + 'label': '是否禁用媒体库的Danmu插件', + } + } + ] } ] }, @@ -858,6 +876,7 @@ class EmbyDanmu(_PluginBase): } ], { "enabled": False, + "disabled": False, "dirs": "", "mediaservers": [], }