fix to_dict
This commit is contained in:
parent
ceeb20ed2d
commit
f7b96daa50
@ -549,6 +549,7 @@ class MediaInfo:
|
|||||||
dicts["type"] = self.type.value if self.type else None
|
dicts["type"] = self.type.value if self.type else None
|
||||||
dicts["detail_link"] = self.detail_link
|
dicts["detail_link"] = self.detail_link
|
||||||
dicts["title_year"] = self.title_year
|
dicts["title_year"] = self.title_year
|
||||||
|
dicts["tmdb_info"]["media_type"] = self.type.value if self.type else None
|
||||||
return dicts
|
return dicts
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
|
@ -30,7 +30,6 @@ class DownloadingTorrent(BaseModel):
|
|||||||
dlspeed: Optional[str] = None
|
dlspeed: Optional[str] = None
|
||||||
media: Optional[dict] = {}
|
media: Optional[dict] = {}
|
||||||
|
|
||||||
|
|
||||||
class TransferInfo(BaseModel):
|
class TransferInfo(BaseModel):
|
||||||
"""
|
"""
|
||||||
文件转移结果信息
|
文件转移结果信息
|
||||||
@ -51,3 +50,12 @@ class TransferInfo(BaseModel):
|
|||||||
fail_list: Optional[list] = []
|
fail_list: Optional[list] = []
|
||||||
# 错误信息
|
# 错误信息
|
||||||
message: Optional[str] = None
|
message: Optional[str] = None
|
||||||
|
|
||||||
|
def to_dict(self):
|
||||||
|
"""
|
||||||
|
返回字典
|
||||||
|
"""
|
||||||
|
dicts = vars(self).copy() # 创建一个字典的副本以避免修改原始数据
|
||||||
|
dicts["path"] = str(self.path) if self.path else None
|
||||||
|
dicts["target_path"] = str(self.target_path) if self.target_path else None
|
||||||
|
return dicts
|
Loading…
x
Reference in New Issue
Block a user