Skip to content

fix(setting): 修复“动态信息”设置失效的问题 - #54

Merged
11273 merged 1 commit into
11273:mainfrom
Robin-zero:fix/meta-setting
Oct 17, 2026
Merged

11273 merged 1 commit into
11273:mainfrom
Robin-zero:fix/meta-setting

Conversation

@Robin-zero

@Robin-zero Robin-zero commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

变更说明

修复下载设置中“动态信息”开关关闭后,重新打开下载管理仍显示开启,以及关闭后仍向媒体文件写入说明、作者、关键词等信息的问题。

  • 修正设置读取逻辑,正确保留已保存的 false 值。
  • 在下载任务创建入口统一应用开关,避免照片或视频携带的动态信息绕过设置。
  • 补充回归测试,明确设置仅影响新建任务;原图已有元数据保留,文件时间设置独立生效。

验证方式

  1. pnpm dev:启动本地服务
  2. 扫码登录
  3. 关闭“动态信息”开关,关闭下载管理弹框,再打开弹框,开关状态保持关闭
  4. 打开“动态信息”开关,关闭下载管理弹框,再打开弹框,开关状态保持打开
  5. 关闭“动态信息”开关,下载的图片不含动态信息
  6. 打开“动态信息”开关,下载的图片包含动态信息
  7. 提交前执行命令:
    • pnpm lint:通过,无错误;存在既有的 CRLF 格式警告。
    • pnpm build:通过。

截图或录屏

  • “动态信息”开关关闭
image
  • “动态信息”开关开启
image

提交前检查

  • 我已阅读并遵守 CONTRIBUTING.md。
  • 我已执行 pnpm lint。
  • 我已执行 pnpm build。
  • 我已补充或更新必要的测试、文档或截图。
  • 本 PR 没有提交 cookie、p_skey、QQ 号、访问令牌、真实媒体或其他个人数据。
  • 我已确认改动不包含未经授权的第三方代码或资源。

发布影响

  • 无用户可见变化,不需要 release note。
  • 有用户可见变化,已在下方说明 release note:

修复“动态信息”开关关闭后状态无法保持、且新建下载任务仍写入说明、作者及关键词等信息的问题。

Summary by CodeRabbit

  • Bug Fixes
    • Settings now preserve explicitly saved values such as false, 0, and empty text.
    • When feed descriptions are disabled, newly created download tasks no longer include feed descriptions or media metadata. Existing tasks retain their current metadata, and the setting applies to tasks created after it changes.

@Robin-zero
Robin-zero requested a review from 11273 as a code owner October 16, 2026 14:48
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: 11273/QzonePhoto/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a4a28701-5683-4cc0-b4b7-680aa690e879
📥 Commits

Reviewing files that changed from the base of the PR and between 50a4484 and fe29017.

📒 Files selected for processing: 2
  • scripts/download-metadata-setting.test.mjs
  • src/main/services/main/download.js

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📝 Walkthrough

getSetting now preserves stored falsy values. createTask reads the feed-description setting when creating a task and stores either the supplied metadata or cleared metadata. Tests cover setting persistence and metadata handling across task types.

Changes: Download metadata settings

Layer / File(s) Summary
Setting retrieval and persistence
src/main/services/main/download.js, scripts/download-metadata-setting.test.mjs
getSetting preserves explicit false, 0, and empty-string values. Tests cover the setting default, updates, persistence, and missing values.
Metadata handling during task creation
src/main/services/main/download.js, scripts/download-metadata-setting.test.mjs
createTask stores supplied description and media metadata when enabled, and cleared metadata when disabled. Tests cover image, video, album, and feed tasks, generated image output, and the effect of setting changes on new and existing tasks.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to fe290

The setting and new-task metadata behavior have no identified merge-blocking issue. Merge after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: fixing the ineffective dynamic-information setting. It matches the settings persistence and task-creation behavior changes.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@11273
11273 merged commit 04ebac8 into 11273:main Oct 17, 2026
4 checks passed
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.

2 participants