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": [], }