mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-11-02 21:34:32 +08:00
refactor(types): govern torrent cache recognition result types
This commit is contained in:
@@ -13,7 +13,7 @@ from app.schemas.types import MUSIC_ENTITY_RECORDING, MediaSource, MediaType, Mu
|
||||
class TorrentCacheRecognitionService:
|
||||
"""执行种子缓存条目的媒体重新识别用例。"""
|
||||
|
||||
def __init__(self, torrents_chain: Any, media_chain: Any):
|
||||
def __init__(self, torrents_chain: Any, media_chain: Any) -> None:
|
||||
"""初始化缓存和媒体识别依赖。"""
|
||||
self.torrents_chain = torrents_chain
|
||||
self.media_chain = media_chain
|
||||
@@ -25,7 +25,7 @@ class TorrentCacheRecognitionService:
|
||||
media_source: Optional[MediaSource] = None,
|
||||
media_id: Optional[str] = None,
|
||||
music_type: Optional[MusicTargetEntityType] = None,
|
||||
) -> tuple[bool, str, Optional[dict]]:
|
||||
) -> tuple[bool, str, Optional[dict[str, object]]]:
|
||||
"""重新识别缓存条目并持久化影视、音乐分离后的缓存。
|
||||
|
||||
返回值保持端点原有的成功标识、用户消息和响应数据三元组,便于旧插件
|
||||
|
||||
@@ -75,7 +75,7 @@ uv run --locked --no-sync python scripts/architecture/complexity.py
|
||||
回调和返回值类型;全仓错误计数为零并不保证单独纳入 strict frontier 后也为零。
|
||||
|
||||
2026-10-16 开始逐文件清理类型债务,`app/domain/title.py` 通过局部可空类型声明保留
|
||||
既有搜索解析行为,并纳入严格清单;当前清单共 53 个文件(52 个生产文件和 1 个脚本)。
|
||||
既有搜索解析行为,并纳入严格清单;当前清单共 54 个文件(53 个生产文件和 1 个脚本)。
|
||||
每个治理提交只修改一个生产文件及其必要测试、门禁配置、真实下降基线和指标文档。
|
||||
验收同时检查完整严格清单与全宿主 Linux 分析,避免 `follow_imports = skip` 隐藏依赖
|
||||
签名冲突;不通过忽略诊断或放宽类型合同接受回退。最新文件清单以 `mypy.ini` 为准,
|
||||
|
||||
@@ -108,7 +108,7 @@ ARCH-201 至 ARCH-204 均达到实现、验证、提交、推送和远端门禁
|
||||
| Event Contract | 53 | 均已有 payload model,但当前全部是 diagnostic enforcement |
|
||||
| Python 源码量 | 371,939 行 | 本次重新扫描物理行数,排除 `app/plugins/**`;74 个文件超过 1,000 行,12 个超过 2,000 行;源码尺寸仅作观察 |
|
||||
| 长方法 | 309 个超过 80 行 | 本次 AST 扫描排除 `app/plugins/**`;61 个超过 150 行,17 个超过 250 行;新增函数仍受 C901/嵌套深度门禁约束 |
|
||||
| 全量 mypy 历史债务 | 9,091 / 499 文件 | 通知排版补齐 Slack 消息块类型,历史债务减少 2 项;工作流资源过滤改用领域对象调用过滤链,恢复的节点输出在消费前归一化,并收紧可空资源列表的类型低水位;消息媒体交互类型债务已清零,canonical Facade 与 endpoint 类型边界已补齐,低水位只允许继续下降;微信 ClawBot 入站 item_list 媒体解析改为按子项键名分派后,类型错误减少 4 项;站点解析器分享率改用浮点初值,类型错误减少 20 项;本次下载与文件安全修复再减少 3 项,逐文件逐错误码无增长 |
|
||||
| 全量 mypy 历史债务 | 9,090 / 498 文件 | 通知排版补齐 Slack 消息块类型,历史债务减少 2 项;工作流资源过滤改用领域对象调用过滤链,恢复的节点输出在消费前归一化,并收紧可空资源列表的类型低水位;消息媒体交互类型债务已清零,canonical Facade 与 endpoint 类型边界已补齐,低水位只允许继续下降;微信 ClawBot 入站 item_list 媒体解析改为按子项键名分派后,类型错误减少 4 项;站点解析器分享率改用浮点初值,类型错误减少 20 项;本次下载与文件安全修复再减少 3 项,逐文件逐错误码无增长 |
|
||||
| Ruff 历史诊断 | 100 | 低水位门禁通过,但规则集只覆盖 `E4/E7/E9/F/I` |
|
||||
| 覆盖率固定基线 | Application 80.00%,Domain 80.00% | Chain、Runtime、Agent、Adapter、Startup 未进入包级覆盖率门禁 |
|
||||
|
||||
|
||||
1
mypy.ini
1
mypy.ini
@@ -33,6 +33,7 @@ files =
|
||||
app/runtime/compat/diagnostics.py,
|
||||
app/runtime/compat/manifest.py,
|
||||
app/application/outbox.py,
|
||||
app/application/torrent/cache.py,
|
||||
app/application/configuration.py,
|
||||
app/application/scheduling.py,
|
||||
app/application/workflow.py,
|
||||
|
||||
@@ -770,9 +770,6 @@
|
||||
"app/application/subscription/write.py": {
|
||||
"arg-type": 2
|
||||
},
|
||||
"app/application/torrent/cache.py": {
|
||||
"type-arg": 1
|
||||
},
|
||||
"app/application/torrent/download.py": {
|
||||
"arg-type": 2,
|
||||
"assignment": 3,
|
||||
|
||||
Reference in New Issue
Block a user