fix: improve Emby to 115 deletion sync - #52
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1915d5e249
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| or not re.fullmatch(r"[A-Za-z0-9_-]{1,256}", parent_id) | ||
| or not raw_path | ||
| or relative_path.is_absolute() | ||
| or len(relative_path.parts) < 2 |
There was a problem hiding this comment.
Require proof that the parent directory belongs to the asset
When an indexed file is directly under a selected category folder, such as 电影/Movie.mkv, this depth check treats the category as a deletable media directory; after the file is trashed and no siblings remain, the workflow also moves the entire 电影 folder to the recycle bin. Path depth does not establish that the parent is an asset-owned directory, so preserve it unless ownership is explicitly recorded or separately confirmed.
AGENTS.md reference: AGENTS.md:L43-L43
Useful? React with 👍 / 👎.
Module scope
media-servermedia-server,strm,cloudCompatibility
trash_receipt_json持久化本次删除范围,并仅在 Emby Webhook 缺失映射时向既有strm_entries补记唯一、待移除映射)Proof
tests/test_deletion_workflow.py: 42 passedpython -m compileall -q backend/app: passedgit diff --check: passedSummary
strm_entries时,复用当前 STRM 投影规则,从完整相对路径唯一恢复映射;同名异目录、多 Provider 歧义及已移除映射继续 fail-closed。Episode与未知类型只删除唯一媒体文件。Baseline: GitHub formal Release
v0.6.12(210a1ccf938176db9f93ffcfcced2d431c266086).No NAS operation, main merge, release, or version change was performed.