This commit is contained in:
jxxghp
2023-08-03 18:39:19 +08:00
parent acac42a7fb
commit 1125cfa6ee
2 changed files with 11 additions and 9 deletions

View File

@ -70,9 +70,9 @@ class CustomHosts(_PluginBase):
pass pass
def get_form(self) -> Tuple[List[dict], Dict[str, Any]]: def get_form(self) -> Tuple[List[dict], Dict[str, Any]]:
""" """
拼装插件配置页面需要返回两块数据1、页面配置2、数据结构 拼装插件配置页面需要返回两块数据1、页面配置2、数据结构
""" """
return [ return [
{ {
'component': 'VForm', 'component': 'VForm',

View File

@ -38,9 +38,8 @@ class LibraryScraper(_PluginBase):
# 限速开关 # 限速开关
_enabled = False _enabled = False
_cron = None _cron = None
_mode = None _scraper_paths = None
_scraper_path = None _exclude_paths = None
_exclude_path = None
# 退出事件 # 退出事件
_event = Event() _event = Event()
@ -49,9 +48,8 @@ class LibraryScraper(_PluginBase):
if config: if config:
self._enabled = config.get("enabled") self._enabled = config.get("enabled")
self._cron = config.get("cron") self._cron = config.get("cron")
self._mode = config.get("mode") self._scraper_paths = config.get("scraper_paths")
self._scraper_path = config.get("scraper_path") self._exclude_paths = config.get("exclude_paths")
self._exclude_path = config.get("exclude_path")
# 停止现有任务 # 停止现有任务
self.stop_service() self.stop_service()
@ -63,6 +61,10 @@ class LibraryScraper(_PluginBase):
logger.info(f"媒体库刮削服务启动,周期:{self._cron}") logger.info(f"媒体库刮削服务启动,周期:{self._cron}")
self._scheduler.add_job(self.__libraryscraper, self._scheduler.add_job(self.__libraryscraper,
CronTrigger.from_crontab(self._cron)) CronTrigger.from_crontab(self._cron))
else:
logger.info(f"媒体库刮削服务启动周期每7天")
self._scheduler.add_job(self.__libraryscraper,
CronTrigger.from_crontab("0 0 */7 * *"))
if self._scheduler.get_jobs(): if self._scheduler.get_jobs():
# 启动服务 # 启动服务
self._scheduler.print_jobs() self._scheduler.print_jobs()