fix schemas
This commit is contained in:
parent
668cfb72c3
commit
5690ee9bd6
@ -93,7 +93,7 @@ class TorrentInfo:
|
||||
"""
|
||||
dicts = asdict(self)
|
||||
dicts["volume_factor"] = self.volume_factor
|
||||
return asdict(self)
|
||||
return dicts
|
||||
|
||||
|
||||
@dataclass
|
||||
@ -147,21 +147,12 @@ class MediaInfo:
|
||||
# 演员
|
||||
actors: List[dict] = field(default_factory=dict)
|
||||
|
||||
def __init__(self, tmdb_info: dict = None, douban_info: dict = None):
|
||||
# 初始化
|
||||
self.seasons = {}
|
||||
self.season_info = []
|
||||
self.season_years = {}
|
||||
self.names = []
|
||||
self.directors = []
|
||||
self.actors = []
|
||||
self.tmdb_info = {}
|
||||
self.douban_info = {}
|
||||
def __post_init__(self):
|
||||
# 设置媒体信息
|
||||
if tmdb_info:
|
||||
self.set_tmdb_info(tmdb_info)
|
||||
if douban_info:
|
||||
self.set_douban_info(douban_info)
|
||||
if self.tmdb_info:
|
||||
self.set_tmdb_info(self.tmdb_info)
|
||||
if self.douban_info:
|
||||
self.set_douban_info(self.douban_info)
|
||||
|
||||
def from_dict(self, data: dict):
|
||||
"""
|
||||
|
@ -332,7 +332,7 @@ class MetaBase(object):
|
||||
return ret_string
|
||||
|
||||
@property
|
||||
def edtion(self) -> str:
|
||||
def edition(self) -> str:
|
||||
"""
|
||||
返回资源类型字符串,不含分辨率
|
||||
"""
|
||||
@ -447,5 +447,5 @@ class MetaBase(object):
|
||||
dicts = asdict(self)
|
||||
dicts["type"] = self.type.value if self.type else None
|
||||
dicts["season_episode"] = self.season_episode
|
||||
dicts["edtion"] = self.edtion
|
||||
dicts["edition"] = self.edition
|
||||
return dicts
|
||||
|
@ -487,7 +487,7 @@ class FileTransferModule(_ModuleBase):
|
||||
# 年份
|
||||
"year": mediainfo.year,
|
||||
# 版本
|
||||
"edition": meta.edtion,
|
||||
"edition": meta.edition,
|
||||
# 分辨率
|
||||
"videoFormat": meta.resource_pix,
|
||||
# 制作组/字幕组
|
||||
|
@ -52,6 +52,8 @@ class MetaInfo(BaseModel):
|
||||
video_encode: Optional[str] = None
|
||||
# 音频编码
|
||||
audio_encode: Optional[str] = None
|
||||
# 资源类型
|
||||
edition: Optional[str] = None
|
||||
|
||||
|
||||
class MediaInfo(BaseModel):
|
||||
|
@ -26,7 +26,7 @@ class MetaInfoTest(TestCase):
|
||||
"part": meta_info.part or "",
|
||||
"season": meta_info.season,
|
||||
"episode": meta_info.episode,
|
||||
"restype": meta_info.edtion,
|
||||
"restype": meta_info.edition,
|
||||
"pix": meta_info.resource_pix or "",
|
||||
"video_codec": meta_info.video_encode or "",
|
||||
"audio_codec": meta_info.audio_encode or ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user