From 3a76877aca0ebdf6eb2d1bb54e71c0bb6c1fa802 Mon Sep 17 00:00:00 2001 From: thsrite Date: Wed, 6 Mar 2024 14:27:21 +0800 Subject: [PATCH] fix --- plugins/cloudstrm/__init__.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/plugins/cloudstrm/__init__.py b/plugins/cloudstrm/__init__.py index ceb7291..5fd1aed 100644 --- a/plugins/cloudstrm/__init__.py +++ b/plugins/cloudstrm/__init__.py @@ -422,13 +422,22 @@ class CloudStrm(_PluginBase): }] """ if self._enabled: - return [{ - "id": "CloudStrm", - "name": "云盘strm文件生成服务", - "trigger": CronTrigger.from_crontab(self._cron), - "func": self.__scan, - "kwargs": {} - }] + if self._cron: + return [{ + "id": "CloudStrm", + "name": "云盘strm文件生成服务", + "trigger": CronTrigger.from_crontab(self._cron), + "func": self.__scan, + "kwargs": {} + }] + else: + return [{ + "id": "CloudStrm", + "name": "云盘strm文件生成服务", + "trigger": None, + "func": self.__scan, + "kwargs": {} + }] return [] def get_api(self) -> List[Dict[str, Any]]: