diff --git a/app/actions/add_download.py b/app/actions/add_download.py index c25eb922..0558c2bf 100644 --- a/app/actions/add_download.py +++ b/app/actions/add_download.py @@ -34,6 +34,8 @@ class AddDownloadAction(BaseAction): super().__init__(action_id) self.downloadchain = DownloadChain() self.mediachain = MediaChain() + self._added_downloads = [] + self._has_error = False @classmethod @property diff --git a/app/actions/add_subscribe.py b/app/actions/add_subscribe.py index 300aa1b6..8c4ac8fa 100644 --- a/app/actions/add_subscribe.py +++ b/app/actions/add_subscribe.py @@ -26,6 +26,8 @@ class AddSubscribeAction(BaseAction): super().__init__(action_id) self.subscribechain = SubscribeChain() self.subscribeoper = SubscribeOper() + self._added_subscribes = [] + self._has_error = False @classmethod @property diff --git a/app/actions/fetch_downloads.py b/app/actions/fetch_downloads.py index 79c0ed48..3e8c6be4 100644 --- a/app/actions/fetch_downloads.py +++ b/app/actions/fetch_downloads.py @@ -21,6 +21,7 @@ class FetchDownloadsAction(BaseAction): def __init__(self, action_id: str): super().__init__(action_id) self.chain = ActionChain() + self._downloads = [] @classmethod @property diff --git a/app/actions/fetch_medias.py b/app/actions/fetch_medias.py index 5364fc10..5d98de60 100644 --- a/app/actions/fetch_medias.py +++ b/app/actions/fetch_medias.py @@ -34,6 +34,8 @@ class FetchMediasAction(BaseAction): def __init__(self, action_id: str): super().__init__(action_id) + self._medias = [] + self._has_error = False self.__inner_sources = [ { "func": RecommendChain().tmdb_trending, diff --git a/app/actions/fetch_rss.py b/app/actions/fetch_rss.py index d0abfef2..eac7a26b 100644 --- a/app/actions/fetch_rss.py +++ b/app/actions/fetch_rss.py @@ -36,6 +36,8 @@ class FetchRssAction(BaseAction): super().__init__(action_id) self.rsshelper = RssHelper() self.chain = ActionChain() + self._rss_torrents = [] + self._has_error = False @classmethod @property diff --git a/app/actions/fetch_torrents.py b/app/actions/fetch_torrents.py index fb17eda8..5e88a465 100644 --- a/app/actions/fetch_torrents.py +++ b/app/actions/fetch_torrents.py @@ -34,6 +34,7 @@ class FetchTorrentsAction(BaseAction): def __init__(self, action_id: str): super().__init__(action_id) self.searchchain = SearchChain() + self._torrents = [] @classmethod @property diff --git a/app/actions/filter_medias.py b/app/actions/filter_medias.py index f6e34158..d14f29f1 100644 --- a/app/actions/filter_medias.py +++ b/app/actions/filter_medias.py @@ -24,6 +24,10 @@ class FilterMediasAction(BaseAction): _medias = [] + def __init__(self, action_id: str): + super().__init__(action_id) + self._medias = [] + @classmethod @property def name(cls) -> str: # noqa diff --git a/app/actions/filter_torrents.py b/app/actions/filter_torrents.py index efc10fbf..8fdd6f2a 100644 --- a/app/actions/filter_torrents.py +++ b/app/actions/filter_torrents.py @@ -33,6 +33,7 @@ class FilterTorrentsAction(BaseAction): super().__init__(action_id) self.torrenthelper = TorrentHelper() self.chain = ActionChain() + self._torrents = [] @classmethod @property diff --git a/app/actions/scan_file.py b/app/actions/scan_file.py index 2a833955..7092d320 100644 --- a/app/actions/scan_file.py +++ b/app/actions/scan_file.py @@ -30,6 +30,8 @@ class ScanFileAction(BaseAction): def __init__(self, action_id: str): super().__init__(action_id) self.storagechain = StorageChain() + self._fileitems = [] + self._has_error = False @classmethod @property diff --git a/app/actions/scrape_file.py b/app/actions/scrape_file.py index ee08f883..1353a991 100644 --- a/app/actions/scrape_file.py +++ b/app/actions/scrape_file.py @@ -28,6 +28,8 @@ class ScrapeFileAction(BaseAction): super().__init__(action_id) self.storagechain = StorageChain() self.mediachain = MediaChain() + self._scraped_files = [] + self._has_error = False @classmethod @property diff --git a/app/actions/transfer_file.py b/app/actions/transfer_file.py index 4ae0f4e8..962bfeaa 100644 --- a/app/actions/transfer_file.py +++ b/app/actions/transfer_file.py @@ -34,6 +34,8 @@ class TransferFileAction(BaseAction): self.transferchain = TransferChain() self.storagechain = StorageChain() self.transferhis = TransferHistoryOper() + self._fileitems = [] + self._has_error = False @classmethod @property diff --git a/app/core/workflow.py b/app/core/workflow.py index 30f23515..a03d0215 100644 --- a/app/core/workflow.py +++ b/app/core/workflow.py @@ -63,6 +63,8 @@ class WorkFlowManager(metaclass=Singleton): if not context: context = ActionContext() if action.type in self._actions: + # 实例化之前,清理掉类对象的数据 + # 实例化 action_obj = self._actions[action.type](action.id) # 执行