Repository navigation
Conversation
禁漫下载的交付物从「整本一个加密 PDF」改为「每章一份加密 PDF,统一密码打包成 一个无密码 zip」:多章节本子不再需要一本几十上百 MB 的单文件才能翻开,zip 解压后 按文件名就是阅读顺序。 - `downloader.py`:`JmDownload` 拆成 `JmChapterArchive`(zip + 每章 PDF 元信息 + `skipped_chapters`,状态 `ok`/`partial`/`empty`)与 `JmPlainDownload`(uid 路径的 单份未加密 PDF),`download_book_pdf` → `download_book`;逐章 `download → _write_pdf → 收集`,每章页面在该章写完即释放,zip 写完后删掉散落副本,任务目录 只留最终交付物。 - zip 条目为 `JM<车号> <三位章节序号>[ <章节标题>].pdf`(序号取服务端章节 `order`, 空章节不占号),zip 用标准库 `zipfile` + `ZIP_DEFLATED` 写成、不加密;每个章节 PDF 各自用同一个随机 8 位密码做 AES-256 加密。 - 体积语义改为单章上限:`[jm].max_file_size` 改名为 `[jm].chapter_max_file_size` (默认仍 100MB),超限只跳过那一章、其余章节照常打包,信息节点写明「N 章未打包」; 旧键失效并回退默认值。zip 总体积不再受配置约束。 - `sender.py`:文件消息改发 zip,密码节点写明「zip 内所有 PDF 的解密密码」;投递语义 不变(文件不进合并转发、转发被明确拒绝才降级两条普通消息、`delivery_uncertain` / `file_transfer_error` 不重发但 zip 照常发送、密码不进历史摘要)。 - `jm_book` 工具的 `output_mode=uid` 维持单份未加密 PDF;配置模板、README、 ARCHITECTURE、docs(configuration / pipelines / usage / development)与工具 README/config.json 描述同步更新。 - 版本 3.18.2 → 3.18.3。
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: 69gg/Undefined/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (26)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
禁漫(JM)下载的交付物从「整本一个加密 PDF」改为「每章一份 AES-256 加密 PDF(同一个随机 8 位密码),打包成一个无密码 zip」:多章节本子不再需要一本几十上百 MB 的单文件才能翻开,zip 解压后按文件名就是阅读顺序。
交付结构:
影响范围
用户可见行为
JM<车号> <三位章节序号>[ <章节标题>].pdf,序号取服务端章节order并补零(空章节不占号,服务端没给标题的章节只留序号、不再重复本子标题)。破坏性配置变更
[jm].max_file_size→[jm].chapter_max_file_size(默认仍 100MB,0不限、<0回退 100)。语义从「整本 PDF 上限」变为「单章 PDF 上限」,超限只丢该章;旧键失效并回退默认值,需要用户改配置。zip 总体积 = 章节数 × 单章上限,不再受配置约束(QQ/NapCat 侧上传上限由部署承担)。config.toml.example、docs/configuration.md、docs/pipelines.md、docs/usage.md、docs/development.md、README.md、ARCHITECTURE.md、jm_book的 README 与config.json描述。内部接口
src/Undefined/jm/downloader.py:JmDownload拆成JmChapterArchive(zip_path+ 每章ChapterPdfInfo+skipped_chapters,状态ok/partial/empty)与JmPlainDownload(uid 路径的单份未加密 PDF);download_book_pdf→download_book,_download_sync拆成_download_archive_sync/_download_plain_sync。download → _write_pdf → 收集,该章页面随即释放(峰值内存 ≈ 一章页面 + 已完成章节 PDF),zip 写完后删掉散落副本,任务目录只留最终交付物;删除「整本源图字节累计超限就中止整本」的预判。src/Undefined/jm/sender.py:_send_result(zip_path=...),build_info_text/build_history_message收窄为JmChapterArchive,无密码时状态节点文案由「PDF 未发送」改为「文件未发送」。delivery_uncertain/file_transfer_error不降级重发但 zip(此前从未发出)照常单独发送、文件自身投递未确认直接上抛。jm_book的output_mode=uid维持单份未加密整本 PDF(供file_analysis_agent解析),仅共用新的单章上限校验。pyproject.toml、src/Undefined/__init__.py、两个 App 的 package/lock/Cargo/tauri.conf 与uv.lock,lock 只改根包版本、无依赖漂移)。关联 Issue
无
自检
uv run ruff check .与uv run ruff format --check .通过(815 files)uv run mypy .通过(815 source files,Success)uv run pytest tests/ --cov通过(覆盖率不低于pyproject.toml中的fail_under)apps/undefined-console/或src/Undefined/webui/static/js/:已跑cd apps/undefined-console && npm run checkapps/undefined-chat/:已跑cd apps/undefined-chat && npm run checkconfig.toml.example与docs/configuration.md说明:未跑全量
pytest --cov(只跑了受影响模块的测试集);两个 App 只有版本号改动,其 Biome / tsc / cargo fmt / check / test 由 pre-commit 全量钩子覆盖。备注
config.toml里的[jm].max_file_size改成[jm].chapter_max_file_size,否则会静默回退默认 100MB。可用uv run python scripts/sync_config_template.py同步模板(旧键不会被自动删除,也不会被读取)。