fix(web): embed missing metadata and cover art when downloading songs#1102
Open
axyn45 wants to merge 3 commits into
Open
fix(web): embed missing metadata and cover art when downloading songs#1102axyn45 wants to merge 3 commits into
axyn45 wants to merge 3 commits into
Conversation
… in browser - Introduce browser-id3-writer for tag injection when downloading MP3 songs in browser (non-Electron environment). - Fetch song and cover image ArrayBuffers asynchronously to write TIT2, TPE1, TALB, TPE2, and USLT frames. - Add network and CORS fault tolerance, automatically falling back to original URL-based download on error to guarantee reliable delivery.
- Fix missing album artist metadata when downloading FLAC audio files in browser environment. - Add albumArtist option to FlacMetadata interface and write ALBUMARTIST tag to Vorbis 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.
修复内容
SPlayer网页端在下载音乐时直接保存了源文件,无法像桌面端那样将歌曲的元数据(标题、歌手、专辑、歌词)以及封面图片嵌入到下载的文件中。**
主要改动
package.json
browser-id3-writer, 无依赖项。src/core/resource/DownloadManager.ts
axios异步拉取歌曲和封面图片的ArrayBuffer二进制数据。browser-id3-writer在内存中为 MP3 音频写入TIT2(标题)、TPE1(歌手)、TALB(专辑)、TPE2(专辑歌手)和USLT(歌词)等 ID3v2 框架,并嵌入APIC(封面图片)。测试
pnpm lint和pnpm format通过。pnpm build打包后的 Web 静态资源与 Electron 原生客户端均编译成功。