From 67756fe55ae6e8086345810127d04d83299be959 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sun, 16 Jul 2023 07:57:45 +0800 Subject: [PATCH] fix dataclass --- app/core/context.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/core/context.py b/app/core/context.py index 0c740f2d..52c63b10 100644 --- a/app/core/context.py +++ b/app/core/context.py @@ -58,6 +58,9 @@ class TorrentInfo: def __setattr__(self, name: str, value: Any): self.__dict__[name] = value + def __getattr__(self, name): + return None + def __get_properties(self): """ 获取属性列表 @@ -175,6 +178,9 @@ class MediaInfo: def __setattr__(self, name: str, value: Any): self.__dict__[name] = value + def __getattr__(self, name): + return None + def __get_properties(self): """ 获取属性列表 @@ -512,9 +518,6 @@ class Context: # 种子信息 torrent_info: TorrentInfo = None - def __setattr__(self, name: str, value: Any): - self.__dict__[name] = value - def to_dict(self): """ 转换为字典