Skip to content

fix: add zip split archive MIME type registration - #510

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:release/eaglefrom
liyigang1:agent/pms-bug-bot/746e2621afae
Oct 15, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:release/eaglefrom
liyigang1:agent/pms-bug-bot/746e2621afae

Conversation

@liyigang1

@liyigang1 liyigang1 commented Oct 14, 2026 •

Copy link
Copy Markdown

Root Cause Analysis

deepin-compressor.xml only registered the 7z split archive glob pattern (*.7z.*), but did not register any MIME type or glob pattern for zip split archives (.zip.001, .z01, etc.). The system freedesktop.org.xml also only covers *.zip/*.zipx without split suffixes. As a result, the file manager falls back to content detection for .zip.001 files → returns text/plain → displays a text icon, while normal .zip files match application/zip → display the archive icon, causing icon inconsistency.

Fix

Add zip split archive MIME type registration in deepin-compressor.xml, mirroring the existing 7z split archive registration. Register application/zip type with glob patterns *.zip.[0-9][0-9][0-9] and *.z[0-9][0-9], and set generic-icon name="deepin-compressor".

Change Safety Assessment

  • Risk level: Low
  • This change only adds new glob patterns to the MIME type registration file, without modifying any existing registrations or code logic
  • No existing behavior is altered; only zip split archive files gain correct MIME type detection and icon display

Influence

  • Test zip split archive (.zip.001) icon display in file manager
  • Test zip split archive (.z01) icon display in file manager
  • Verify normal .zip files still display the correct icon

根因分析

deepin-compressor.xml 仅注册了 7z 分卷压缩包的 glob 模式(*.7z.*),未为 zip 分卷压缩包(.zip.001、.z01 等)注册任何 MIME 类型或 glob 模式。系统 freedesktop.org.xml 也仅覆盖 *.zip/*.zipx,不含分卷后缀。因此文件管理器对 .zip.001 等文件回退到内容检测 → 返回 text/plain → 显示文本图标,而普通 .zip 匹配 application/zip → 显示压缩包图标,导致图标不一致。

修复方案

在 deepin-compressor.xml 中新增 zip 分卷压缩包 MIME 类型注册,镜像现有 7z 分卷注册方式。注册 application/zip 类型,添加 *.zip.[0-9][0-9][0-9] 和 *.z[0-9][0-9] glob 模式,设置 generic-icon name="deepin-compressor"。

改动安全评估

  • 风险等级:低
  • 本次改动仅在 MIME 类型注册文件中新增 glob 模式,不修改任何已有注册或代码逻辑
  • 不改变任何现有行为,仅使 zip 分卷压缩包文件获得正确的 MIME 类型检测和图标显示

影响范围

  • 测试文件管理器中 zip 分卷压缩包 (.zip.001) 图标显示
  • 测试文件管理器中 zip 分卷压缩包 (.z01) 图标显示
  • 验证普通 .zip 文件图标显示不受影响

PMS: BUG-268375

Summary by Sourcery

Register MIME metadata for split ZIP archives so they are recognized and displayed consistently with regular archives.

New Features:

  • Register split ZIP archive filename patterns with the application/zip MIME type and compressor icon.

Bug Fixes:

  • Ensure .zip.001 and .z01 split archives receive correct MIME detection and file manager icons instead of being treated as plain text.

1. Add zip split archive MIME type registration in deepin-compressor.xml
2. Register application/zip type with glob patterns *.zip.[0-9][0-9][0-9] and *.z[0-9][0-9]
3. Set generic-icon to deepin-compressor for consistent icon display

Log: Fixed zip split archive icon inconsistency after upgrade

Influence:
1. Test zip split archive (.zip.001) icon display in file manager
2. Test zip split archive (.z01) icon display in file manager
3. Verify normal .zip files still display correct icon

fix: 新增 zip 分卷压缩包 MIME 类型注册

1. 在 deepin-compressor.xml 中新增 zip 分卷压缩包 MIME 类型注册
2. 注册 application/zip 类型,添加 *.zip.[0-9][0-9][0-9] 和 *.z[0-9][0-9] glob 模式
3. 设置 generic-icon 为 deepin-compressor 确保图标显示一致

Log: 修复升级后 zip 分卷压缩包图标显示不一致的问题

Influence:
1. 测试文件管理器中 zip 分卷压缩包 (.zip.001) 图标显示
2. 测试文件管理器中 zip 分卷压缩包 (.z01) 图标显示
3. 验证普通 .zip 文件图标显示不受影响

PMS: BUG-268375
@sourcery-ai

sourcery-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR extends the MIME database with two split-ZIP glob patterns under application/zip, mirroring the existing split-7z registration and preserving the existing archive icon behavior for normal ZIP files.

Flow diagram for split ZIP MIME detection

flowchart LR
    A[ZIP split archive file] --> B{Filename matches registered glob}
    B -->|*.zip.#91;0-9#93;#91;0-9#93;#91;0-9#93;| C[application/zip]
    B -->|*.z#91;0-9#93;#91;0-9#93;| C
    C --> D[deepin-compressor icon]
Loading

File-Level Changes

Change Details Files
Register split ZIP archive filename patterns under the existing application/zip MIME type so they receive archive detection and the compressor icon.
  • Add glob matching for numeric .zip.001-style split parts.
  • Add glob matching for .z01-style split parts.
  • Assign the deepin-compressor generic icon to the registration.
src/assets/mimetype/deepin-compressor.xml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: liyigang1, max-lvs

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@liyigang1

Copy link
Copy Markdown
Author

/merge

@deepin-bot
deepin-bot Bot merged commit 9de63ea into linuxdeepin:release/eagle Oct 15, 2026
14 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.

3 participants