Skip to content

feat: 优化 GitHub Actions 合并 PDF 时的文件名生成规则#530

Closed
hect0x7 wants to merge 1 commit intomasterfrom
fix-pdf-sort
Closed

feat: 优化 GitHub Actions 合并 PDF 时的文件名生成规则#530
hect0x7 wants to merge 1 commit intomasterfrom
fix-pdf-sort

Conversation

@hect0x7
Copy link
Copy Markdown
Owner

@hect0x7 hect0x7 commented Apr 16, 2026

原来使用简单的 AidPid 进行命名,用户反馈导出的 PDF 名字全是数字看不出是什么。现在:

  1. 默认情况下,本子维度的 PDF 命名为 Atitle,章节维度的 PDF 命名为 Atitle_Ptitle

  2. 新增可选的环境变量和 Action 面板输入参数 PDF_NAME_RULE,允许用户自定义生成规则。

Summary by CodeRabbit

  • New Features
    • Added configurable PDF filename naming rule option to workflow dispatch with sensible defaults for different merge strategies.

原来使用简单的 `Aid` 或 `Pid` 进行命名,用户反馈导出的 PDF 名字全是数字看不出是什么。现在:

1. 默认情况下,本子维度的 PDF 命名为 `Atitle`,章节维度的 PDF 命名为 `Atitle_Ptitle`。

2. 新增可选的环境变量和 Action 面板输入参数 `PDF_NAME_RULE`,允许用户自定义生成规则。
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 16, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c51e470b-1779-40de-b013-db0e6358b476

📥 Commits

Reviewing files that changed from the base of the PR and between 145af2a and 62e308c.

📒 Files selected for processing (2)
  • .github/workflows/download_dispatch.yml
  • usage/workflow_download.py

📝 Walkthrough

Walkthrough

This PR introduces a configurable PDF naming rule for merged PDFs via a new GitHub Actions workflow dispatch input PDF_NAME_RULE. The input is propagated to the job environment and used by the PDF plugin configuration, with sensible defaults based on the merge dimension (album vs. photo).

Changes

Cohort / File(s) Summary
GitHub Actions Workflow Configuration
.github/workflows/download_dispatch.yml
Added new workflow dispatch input PDF_NAME_RULE (string type, optional, default empty string) and propagated it to job environment for downstream consumption.
PDF Filename Rule Configuration
usage/workflow_download.py
Updated cover_option_config to use configurable filename_rule from PDF_NAME_RULE environment variable, with defaults of [{Aid}] {Atitle} for album-dimension and [{Aid}] {Pindex}_{Pid}_{Ptitle} for chapter-dimension merging.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • Dev #489: Modifies the same PDF plugin filename rule logic in usage/workflow_download.py, providing context for how the PDF_NAME_RULE configuration is integrated with the Img2pdf plugin.

Poem

🐰 A naming rule hops into the fold,
Where PDFs now dance to patterns untold,
Album or chapter, the choice is quite clear,
Customizable names make workflows more dear! 📄✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-pdf-sort

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

To prevent beginners from mistakenly submitting PRs,
if your PR only modifies the usage/workflow_download.py file,
it will be automatically closed.
If you really want to submit a PR, please reopen it yourself.
Make sure you know what you are doing!

@github-actions github-actions bot closed this Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant