From 95df9dc45fc2264bc0490fcff999eee56b4530b9 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 23 May 2024 08:22:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=AE=E5=BD=95=E7=9B=91=E6=8E=A7=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=88=AE=E5=89=8A=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/dirmonitor/__init__.py | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/plugins/dirmonitor/__init__.py b/plugins/dirmonitor/__init__.py index abf941a..934db48 100644 --- a/plugins/dirmonitor/__init__.py +++ b/plugins/dirmonitor/__init__.py @@ -59,7 +59,7 @@ class DirMonitor(_PluginBase): # 插件图标 plugin_icon = "directory.png" # 插件版本 - plugin_version = "2.0" + plugin_version = "2.1" # 插件作者 plugin_author = "jxxghp" # 作者主页 @@ -83,6 +83,7 @@ class DirMonitor(_PluginBase): _onlyonce = False _cron = None _size = 0 + _scrape = True # 模式 compatibility/fast _mode = "fast" # 转移方式 @@ -119,6 +120,7 @@ class DirMonitor(_PluginBase): self._interval = config.get("interval") or 10 self._cron = config.get("cron") self._size = config.get("size") or 0 + self._scrape = config.get("scrape") or False # 停止现有任务 self.stop_service() @@ -235,7 +237,8 @@ class DirMonitor(_PluginBase): "exclude_keywords": self._exclude_keywords, "interval": self._interval, "cron": self._cron, - "size": self._size + "size": self._size, + "scrape": self._scrape }) @eventmanager.register(EventType.PluginAction) @@ -419,7 +422,8 @@ class DirMonitor(_PluginBase): transfer_type=transfer_type, target=target, meta=file_meta, - episodes_info=episodes_info) + episodes_info=episodes_info, + scrape=self._scrape) if not transferinfo: logger.error("文件转移模块运行失败") @@ -457,7 +461,7 @@ class DirMonitor(_PluginBase): ) # 刮削单个文件 - if settings.SCRAP_METADATA: + if transferinfo.need_scrape: self.chain.scrape_metadata(path=transferinfo.target_path, mediainfo=mediainfo, transfer_type=transfer_type) @@ -824,6 +828,22 @@ class DirMonitor(_PluginBase): } } ] + }, + { + 'component': 'VCol', + 'props': { + 'cols': 12, + 'md': 4 + }, + 'content': [ + { + 'component': 'VSwitch', + 'props': { + 'model': 'scrape', + 'label': '刮削元数据', + } + } + ] } ] }, @@ -950,7 +970,8 @@ class DirMonitor(_PluginBase): "exclude_keywords": "", "interval": 10, "cron": "", - "size": 0 + "size": 0, + "scrape": True } def get_page(self) -> List[dict]: