mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-06 07:56:52 +08:00
feat(agent): complete music workflow support
This commit is contained in:
@@ -81,7 +81,7 @@ class TransferHistory(BaseModel):
|
||||
dest: Optional[str] = None
|
||||
# 转移模式
|
||||
mode: Optional[str] = None
|
||||
# 类型:电影、电视剧
|
||||
# 类型:电影、电视剧、音乐
|
||||
type: Optional[str] = None
|
||||
# 二级分类
|
||||
category: Optional[str] = None
|
||||
@@ -105,6 +105,10 @@ class TransferHistory(BaseModel):
|
||||
media_source: Optional[str] = None
|
||||
# 数据源原生ID
|
||||
media_id: Optional[str] = None
|
||||
# 音乐实体类型:recording 单曲、album 专辑
|
||||
music_type: Optional[str] = None
|
||||
# 专辑预期总曲目数
|
||||
total_tracks: Optional[int] = None
|
||||
# 季Sxx
|
||||
seasons: Optional[str] = None
|
||||
# 集Exx
|
||||
|
||||
@@ -30,11 +30,16 @@ class MediaType(Enum):
|
||||
|
||||
|
||||
def media_type_to_agent(value) -> Optional[str]:
|
||||
"""将 MediaType 枚举或字符串统一转换为 Agent 媒体类型。"""
|
||||
"""将枚举、Agent 键或数据库枚举值统一转换为 Agent 媒体类型。"""
|
||||
if isinstance(value, MediaType):
|
||||
return value.to_agent()
|
||||
if isinstance(value, str):
|
||||
mt = MediaType.from_agent(value)
|
||||
if not mt:
|
||||
try:
|
||||
mt = MediaType(value)
|
||||
except ValueError:
|
||||
pass
|
||||
return mt.to_agent() if mt else value
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user