83 Commits

Author SHA1 Message Date
Aqr-K
f3c1449c8b fix(storage): preserve transfer contents and cleanup identities (#7142) 2026-10-23 06:51:54 +08:00
jxxghp
6d4ce83837 fix(types): clear host mypy debt and prevent typing regressions
严格检查全部宿主源码,清零类型错误预算并移除按模块类型豁免。
按原因、所属方法、错误码及语法指纹锁定必要兼容例外和站点类型桩,
CI 阻断新增忽略、检查范围退化、本地桩替代真实接口及新的类型错误。

修复空值、异步和供应方类型边界,保持插件与 API 兼容合同,
并补充存储、订阅、通知、Agent 和工作流边界的回归覆盖。
2026-10-21 22:03:18 +08:00
jxxghp
f090d22df2 fix(transfer): continue overwrite after target cleanup
## 问题

覆盖裁决确认旧媒体库目标存在后,洗版流程可能在实际备份前删除旧目标。恢复整理时备份步骤把旧目标和备份都不存在视为未知冲突,任务进入人工复核,暂存的新版本无法入库。

## 修复

- 备份步骤在确认旧目标已被外部删除、且备份目标也不存在时记录为无副作用跳过。
- 继续提升已完整暂存的新版本;移动整理仍在提升成功后清理源文件。
- 查询失败、两端同时存在或存在备份但状态矛盾时继续保持人工复核保护。
- 增加持久整理回归测试,覆盖覆盖裁决后旧目标被删除的场景。

## 验证

- `tests/test_transfer_safe_overwrite.py`:94 passed
- 整理执行、持久化、人工复核、提交、worker、计划测试:202 passed
- changed-file Pylint:10.00/10

Fixes #7120
2026-10-21 12:54:06 +08:00
jxxghp
6766a0516e fix(transfer): recover legacy 115 receipts and isolate cloud copies
Validate old instant-upload receipts against frozen source bytes and the original cloud file ID before source deletion. Isolate native 115 copies before renaming, verify moved object IDs, and quarantine uncertain native operations instead of replaying them. Require explicit delete success.

Refs #7099
2026-10-20 17:33:51 +08:00
jxxghp
9f03157977 fix(transfer): ignore timestamps in cleanup identity checks 2026-10-19 19:09:12 +08:00
jxxghp
6e5c9d0afb fix(storage): 修复 reflink 同存储回退语义与测试稳定性 (#7081)
- transhandler: 恢复同存储 copy/move 的 elif 回退语义,不再在 item 操作未命中后重复调用远端操作
- local: reflink 空源路径直接失败,避免新增 mypy 存量债务
- tests: 管道用例改为模拟克隆,系统用例改用真实能力探测,并新增不支持时严格失败的用例
- mcp: 整理历史模式说明补充 reflink
2026-10-19 17:07:02 +08:00
秋澪Akimio
114c2cebe5 feat(storage): 本地存储增加引用链接(reflink)整理方式 (#7077) 2026-10-19 16:48:41 +08:00
DDSRem
e0642eafa7 chore(types): reduce v3 host mypy debt (#7057)
* chore(types): clear AniList endpoint mypy debt

* chore(types): clear Douban endpoint mypy debt

* chore(types): clear recommendation endpoint mypy debt

* chore(types): clear subscription notification mypy debt

* chore(types): clear SDK string compatibility mypy debt

* chore(types): ratchet v3 host mypy across remaining files

* chore(types): reduce v3 host mypy debt and retire ledger

* chore(types): reconcile host snapshot with upstream HTTP pool

* test(types): cover host paths exposed by mypy cleanup
2026-10-18 09:37:49 +08:00
DDSRem
2de976f6b3 Merge pull request #7050 from DDSRem-Dev/codex-comment-migration
docs: 统一全项目中文注释和结构化契约说明
2026-10-17 19:26:29 +08:00
jxxghp
4955b7b9ea fix: harden backend isolation and execution safety 2026-10-16 09:11:28 +08:00
jxxghp
72c8bff312 feat(music): preserve local covers and fall back after online scraping fails 2026-10-14 23:15:41 +08:00
jxxghp
c670432882 fix(transfer): preserve success on size overwrite decline (#6960) 2026-10-11 12:22:10 +08:00
jxxghp
979f625017 feat(music): recognize and archive whole-album CUE resources 2026-09-30 02:59:57 +08:00
jxxghp
6ae5b9d9f0 fix(transfer): preserve frozen source step identity 2026-09-07 12:20:44 +08:00
jxxghp
0528e531e3 fix(transfer): keep directory intercept intent stable 2026-09-03 16:14:58 +08:00
jxxghp
71147c1d96 feat(classification): support multi-source media rules 2026-09-03 11:51:18 +08:00
jxxghp
c4d8185d8d refactor(transfer): keep planning rejection within complexity budget 2026-09-01 07:42:53 +08:00
jxxghp
94716484b7 fix(transfer): resolve durable failure recovery issues 2026-09-01 07:11:06 +08:00
jxxghp
27f357b1d2 fix(transfer): create local target before remote download (#6493) 2026-08-29 10:35:24 +08:00
jxxghp
f134e068e7 refactor: normalize capability module paths 2026-08-27 22:20:38 +08:00
jxxghp
e82ce8447c refactor: complete durable transfer execution settlement 2026-08-27 20:27:42 +08:00
jxxghp
23bff6b2bb refactor: add durable transfer planning checkpoints 2026-08-27 13:16:33 +08:00
jxxghp
9dbe424c3d refactor(config): retire RuntimeSettingsCompat host usage 2026-08-26 15:55:21 +08:00
jxxghp
574c50586e feat(music): 完善歌词与专辑目录整理 2026-08-25 21:02:26 +08:00
jxxghp
dd6405389c refactor: route storage module settings through runtime 2026-08-23 03:12:51 +08:00
jxxghp
5128ae9e1e refactor: 推进后端分层架构治理 2026-08-18 00:29:14 +08:00
jxxghp
369d7d6448 refactor: reorganize backend module boundaries 2026-08-14 19:53:33 +08:00
jxxghp
7b3444c366 refactor backend module architecture 2026-08-14 15:45:38 +08:00
Aqr-K
a2e70b443d fix(monitor,transfer): 修复 FUSE 挂载无响应导致的监控冻死、整理链锁死与漏件 (#6276)
* wip(v3): 移植监控与整理韧性修复到 v3 基线

包含:监控看门狗隔离/挂载探测、整理队列持久化、文件系统子进程代理、
写入原子化。迁移重挂到 v3 链 8a4c7e1d2f90 -> 7f5c1d2e3a4b -> e3d9f4b7c806。
tmdb 相关测试尚未通过,待定位。

* fix(v3): 修正移植引入的 16 项测试失败

- poller.py:合并时我方保留的行仍用旧变量名 merged_snapshot,而 v3 已统一
  改名为 current_snapshot,导致 NameError 被外层 except 吞掉、快照从未保存
- smb.py:采纳 f-string 拆分写法,恢复 Python 3.11 可解析
- dispatcher 测试:历史查重由 _should_skip_by_history 统一承担,mock 点随之调整
- tmdb 缓存测试:补充 v3 新增的 media_source/media_id 字段
- tmdb 重试测试:为 fake 补充 match_multi/async_match_multi

尚余 3 项与 v3 识别流程的连接失败处理有关,待单独判断。

* fix(v3): 测试适配 v3 的 media_source/media_id 重构

v3 将媒体标识从 tmdbid 统一重构为 media_source + media_id,recognize_media
的 tmdbid 参数已被 **kwargs 静默吞掉——传了也不生效,流程会误降级到名称搜索。
tmdb 重试用例改用新参数后恢复正确路径。

同时修正 fake 的 match_multi 语义:真实实现(tmdbapi.match_multi)吞掉所有
异常并返回 None,连接失败与「未找到」在该路径上本就不可区分,fake 需保持一致。

至此移植引入的 19 项失败全部清零。

---------

Co-authored-by: Aqr-K <Aqr-K@users.noreply.github.com>
2026-08-13 08:19:54 +08:00
jxxghp
baf8850d63 refactor(api): standardize responses and restore media config contracts 2026-08-12 23:15:13 +08:00
jxxghp
97dba2a8ae feat: unify media recognition and music lifecycle 2026-08-12 06:51:58 +08:00
naughtyGitCat
3eed518f83 fix(transhandler): suppress noisy error notification for TV special and extra sample files without episode numbers
BD-BOX releases for Anime and TV shows frequently contain extra non-episode video files (such as NCOP, NCED, Menu, PV, CM, SP, Event, Logo, etc.). When transferring these single files, the lack of an episode number previously logged a warning and triggered a noisy '整理失败:未识别到文件集数' notification to users.

This change identifies known special/extra file patterns when begin_episode is None, logs them at INFO level, and suppresses the error notification while returning success to avoid false-positive failure alerts.
2026-08-09 14:48:18 +08:00
jxxghp
05d15a04f5 feat(v3): add music automation workflow 2026-08-07 21:50:22 +08:00
Aqr-K
cf80b551f9 fix(monitor): 目录监控自愈、快照语义修正与覆盖保护闭环 (#6210) 2026-07-30 06:53:52 +08:00
InfinityPacer
a4f6e13881 fix(transfer): expose file meta in intercept event (#6019) 2026-06-29 06:44:40 +08:00
jxxghp
2255b61195 fix: latest覆盖模式误删多Part文件 (fix #5862) 2026-05-30 20:28:26 +08:00
jxxghp
fd4d162287 fix: respect OpenList directory path contract 2026-05-20 22:28:38 +08:00
jxxghp
617692616c fix: build complete transfer result at source 2026-05-20 22:09:57 +08:00
jxxghp
72ead2970c fix: tolerate delayed OpenList metadata 2026-05-20 15:53:56 +08:00
jxxghp
3ec0964a01 fix: handle OpenList delayed transfer metadata 2026-05-20 13:08:45 +08:00
InfinityPacer
9e0846961f feat(filemanager): add TransferRenameBuild chain event and fix TemplateContextBuilder concurrency (#5792) 2026-05-20 09:41:42 +08:00
XiaoChao Fang
cdddd8e080 fix: preserve tv bluray disc folders (#5788) 2026-05-19 16:42:23 +08:00
jxxghp
f0bc1bd681 fix: prevent storage operations in preview mode and add tests for transfer preview logic 2026-05-13 13:39:57 +08:00
album
05b34b9c26 feat(transfer): 增加手动整理预览模式(preview mode)
- ManualTransferItem/TransferTask 增加 preview 字段,支持同一接口双模式
- /api/v1/transfer/manual 透传 preview,预览时返回结构化结果不落盘
- ChainBase.transfer 增加 preview 参数并透传到 run_module
- TransferChain.do_transfer 预览分支复用完整命名/覆盖判定逻辑(dry-run)
- TransferChain.do_transfer 预览结束后显式 finish_task/fail_task,避免任务残留 running 状态导致重复预览失败
- TransHandler.transfer_media 预览分支跳过实际 copy/move/link/delete,仅返回目标路径
- FileManagerModule.transfer 透传 preview 参数
- 修复 /manual 失败分支 dict 类型导致 Response.message 校验错误
- 兼容性:preview 字段有默认值,旧客户端不传参时行为不变
2026-05-12 10:14:58 +08:00
jxxghp
5d588ee127 fix: correct traditional Chinese subtitle rename detection
Fixes #5703
2026-04-28 09:00:14 +08:00
DDSRem
1b489ba581 feat(transfer): TransferOverwriteCheck 支持插件提供源文件真实大小
strm → strm 整理场景下,源 .strm 的 fileitem.size 同样不准,
size 模式比较仍会失效,新增 source_size 输出字段允许插件同时
覆盖源/目标的真实媒体大小。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 17:28:24 +08:00
DDSRem
4d9f17b083 feat(transfer): 新增 TransferOverwriteCheck 事件支持插件介入覆盖判断
允许插件在覆盖模式判断前提供目标文件的真实大小或直接给出覆盖决策,
解决 .strm 等本地大小不准的场景下 size 模式失效的问题。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 17:28:24 +08:00
DDSRem
f70881bb4f feat: TransferRename 事件增加 source_item 源文件信息 2026-04-03 17:51:05 +08:00
DDSRem
60ac901c6c feat: TransferRename 事件增加 source_path 源文件路径参数
在智能重命名事件中传递源文件路径,便于插件在重命名时获取待整理文件的原始路径信息。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 06:55:06 +08:00
jxxghp
f38cb274e4 Revert "refactor(helper): 将LLMHelper StorageHelper的相关方法改为静态方法,移除实例调用"
This reverts commit 9f381b3c73.
2026-03-14 18:19:47 +08:00