From 668cfb72c3ecca627ac159e2947e377ecb3cc947 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sat, 8 Jul 2023 16:37:27 +0800 Subject: [PATCH] fix download --- app/core/context.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/core/context.py b/app/core/context.py index 84abfb84e..a68c3b2d7 100644 --- a/app/core/context.py +++ b/app/core/context.py @@ -168,7 +168,9 @@ def from_dict(self, data: dict): 从字典中初始化 """ for key, value in data.items(): - setattr(self, key, value) + attr = getattr(self, key, None) + if attr and not isinstance(attr, property): + setattr(self, key, value) if isinstance(self.type, str): self.type = MediaType(self.type)