Implement proper architecture: module->chain->API with single CategoryHelper

Co-authored-by: jxxghp <51039935+jxxghp@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-26 04:07:56 +00:00
parent 71cde6661d
commit 27756a53db
5 changed files with 80 additions and 63 deletions

View File

@@ -5,6 +5,7 @@ from app import schemas
from app.chain import ChainBase
from app.core.context import MediaInfo
from app.schemas import MediaType
from app.schemas.category import CategoryConfig
class TmdbChain(ChainBase):
@@ -320,3 +321,15 @@ class TmdbChain(ChainBase):
if infos:
return [info.backdrop_path for info in infos if info and info.backdrop_path][:num]
return []
def load_category_config(self) -> CategoryConfig:
"""
加载分类策略配置
"""
return self.run_module("load_category_config")
def save_category_config(self, config: CategoryConfig) -> bool:
"""
保存分类策略配置
"""
return self.run_module("save_category_config", config=config)