Skip to content

fix: 扫描本地音乐时漏掉 opus 后缀音频#880

Merged
imsyy merged 1 commit into
SPlayer-Dev:devfrom
Tseshongfeeshur:dev
Feb 12, 2026
Merged

fix: 扫描本地音乐时漏掉 opus 后缀音频#880
imsyy merged 1 commit into
SPlayer-Dev:devfrom
Tseshongfeeshur:dev

Conversation

@Tseshongfeeshur
Copy link
Copy Markdown
Contributor

在支持的后缀列表中追加了 , "opus" ,且经测试(GNU/Linux)其可以正常解析opus格式的元数据。

相关 issue:#879

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Tseshongfeeshur, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求旨在通过扩展应用程序支持的音乐文件扩展名列表来纠正一个缺陷,确保应用程序能够正确识别和处理 Opus 格式的音频文件。这提升了用户体验,使得拥有 Opus 文件的用户能够无缝地将这些文件纳入其音乐库中。

Highlights

  • 修复本地音乐扫描: 解决了在扫描本地音乐时遗漏 Opus 格式音频文件的问题。
  • 支持 Opus 格式: 在支持的音乐文件扩展名列表中追加了“opus”后缀,确保应用程序能够识别和处理 Opus 音频文件。
Changelog
  • electron/main/services/MusicMetadataService.ts
    • MUSIC_EXTENSIONS 数组中添加了“opus”作为支持的音乐文件扩展名。
Activity
  • 此拉取请求自创建以来没有记录到任何评论或审查活动。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

这个 PR 在扫描本地音乐时增加了对 opus 格式的支持,解决了相关 issue。代码修改是正确的。我的审查评论中包含一个建议,即进一步扩展支持的文件扩展名列表,以包含 music-metadata 库同样支持的其他格式。这将提高功能的完整性,并与项目中的原生扫描器实现保持更好的一致性。


/** 支持的音乐文件扩展名列表 */
const MUSIC_EXTENSIONS = ["mp3", "wav", "flac", "aac", "webm", "m4a", "ogg", "aiff", "aif", "aifc"];
const MUSIC_EXTENSIONS = ["mp3", "wav", "flac", "aac", "webm", "m4a", "ogg", "aiff", "aif", "aifc", "opus"];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

这个修改很好,正确地添加了 opus 支持。

不过,我注意到 native/tools/src/scanner.rs 文件中有一个更全面的支持扩展名列表。scanDirectory 函数使用的 music-metadata 库实际上也支持更多的格式,例如 ape, wv, mpc, dsf, dff, mkv, mkamp4

为了提高格式支持的覆盖范围并与原生扫描器保持一致,建议将这些格式也添加到 MUSIC_EXTENSIONS 中。为了可读性,最好将所有扩展名按字母顺序排序。

Suggested change
const MUSIC_EXTENSIONS = ["mp3", "wav", "flac", "aac", "webm", "m4a", "ogg", "aiff", "aif", "aifc", "opus"];
const MUSIC_EXTENSIONS = ["aac", "aif", "aifc", "aiff", "ape", "dsf", "dff", "flac", "m4a", "mka", "mkv", "mp3", "mp4", "mpc", "ogg", "opus", "wav", "webm", "wv"];

@imsyy imsyy merged commit b68e105 into SPlayer-Dev:dev Feb 12, 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.

2 participants