mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
refactor(db): 修复异步连接池无界增长,并完成 SQLAlchemy 2.0 迁移与分层归位 (#6320)
This commit is contained in:
@@ -2,16 +2,28 @@
|
||||
from types import SimpleNamespace
|
||||
|
||||
from app.chain.transfer import JobManager, TransferChain
|
||||
from app.domain.meta.metabase import MetaBase
|
||||
from app.runtime.config import settings
|
||||
from app.schemas import FileItem, TransferTask
|
||||
from app.schemas import FileItem
|
||||
from app.application.transfer import TransferTask
|
||||
from app.schemas.types import MediaType
|
||||
|
||||
|
||||
class _FakeMeta:
|
||||
"""构造最小可用的剧集元数据。"""
|
||||
class _FakeMeta(MetaBase):
|
||||
"""
|
||||
构造最小可用的剧集元数据。
|
||||
|
||||
继承 MetaBase 而非鸭子类型:TransferTask.meta 已标注为 MetaBase,pydantic 会做
|
||||
isinstance 校验。三个类级属性用来遮蔽 MetaBase 上的同名 property。
|
||||
"""
|
||||
|
||||
name = None
|
||||
episode_list = None
|
||||
season_episode = None
|
||||
|
||||
def __init__(self, episode: int, season: int = 1):
|
||||
"""初始化剧集编号相关字段。"""
|
||||
super().__init__(title=f"Test Show S{season:02d}E{episode:02d}")
|
||||
self.name = "Test Show"
|
||||
self.title = f"Test Show S{season:02d}E{episode:02d}"
|
||||
self.year = "2026"
|
||||
|
||||
Reference in New Issue
Block a user