feat(agent): complete music workflow support

This commit is contained in:
jxxghp
2026-08-10 08:11:54 +08:00
parent 1fc255b8a7
commit b3b376f2b1
40 changed files with 2224 additions and 266 deletions
+5 -1
View File
@@ -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
+6 -1
View File
@@ -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