目录监控增加刮削开关

This commit is contained in:
jxxghp
2024-05-23 08:22:35 +08:00
parent 1abc4fcb33
commit 95df9dc45f

View File

@@ -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]: