[PR #502] [MERGED] feat: 对本地歌词的修改 #487

Closed
opened 2026-02-27 07:12:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/imsyy/SPlayer/pull/502
Author: @MoYingJi
Created: 10/22/2025
Status: Merged
Merged: 10/22/2025
Merged by: @imsyy

Base: devHead: feat


📝 Commits (4)

  • 103bf79 本地音乐歌词的修改
  • 9fc1746 feat: 支持从本地读取歌词覆盖线上歌词
  • a119423 log 怎么又忘删了
  • ad807cf chore: 规范代码 添加分号

📊 Changes

7 files changed (+160 additions, -39 deletions)

View changed files

📝 electron/main/ipcMain.ts (+35 -14)
📝 src/components/Setting/LocalSetting.vue (+36 -3)
📝 src/stores/setting.ts (+3 -0)
📝 src/utils/helper.ts (+50 -16)
📝 src/utils/lyric.ts (+23 -2)
📝 src/utils/player-utils/lyric.ts (+11 -2)
📝 src/utils/player.ts (+2 -2)

📄 Description

  • 本地音乐优先使用外部歌词而非音乐内封歌词
    因为个人认为内封的歌词不好取出,而单独文件的歌词可以更好地移除和修改,所以单独文件的歌词优先级高于内封歌词
  • 支持本地 TTML 歌词,将同名 .ttml 文件放在此音乐相同位置即可
  • 支持从本地特定位置读取 .lrc 和 .ttml 歌词覆盖线上歌词
    因为部分线上歌词质量低劣,可以自己修改以获得更好观感,也可以尝试 AMLL TTML DB 中尚未被合并的歌词

修改

本地音乐歌词的修改

Commit 信息里的 TTML 手快打错了,不要在意(

修改了 ipcMain.ts 中的 get-music-lyriclyric.ts 中的 parseLocalLyric 使其支持 ttml 的同时提高从文件读取歌词的优先级,player.ts 中的调用也跟着改了

支持从本地读取歌词覆盖线上歌词

  • 增加了 localLyricPath 设置项
    这个设置项和 localFilesPath 很像,因此为了减少代码重合,重构了 helper.ts 中的 changeLocalPath 使其可以应对更多情况
  • ipcMain.ts 中增加 read-local-lyric 以使用路径、歌曲ID、扩展名读取覆盖的歌词文件
  • lyric.ts 中获取线上歌词前先调用 read-local-lyric 获取本地的覆盖歌词

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/imsyy/SPlayer/pull/502 **Author:** [@MoYingJi](https://github.com/MoYingJi) **Created:** 10/22/2025 **Status:** ✅ Merged **Merged:** 10/22/2025 **Merged by:** [@imsyy](https://github.com/imsyy) **Base:** `dev` ← **Head:** `feat` --- ### 📝 Commits (4) - [`103bf79`](https://github.com/imsyy/SPlayer/commit/103bf7948d3631550a116095c0033c8817afb76b) 本地音乐歌词的修改 - [`9fc1746`](https://github.com/imsyy/SPlayer/commit/9fc1746495fbb7ab598ad371b4df181a7ec0b2c4) feat: 支持从本地读取歌词覆盖线上歌词 - [`a119423`](https://github.com/imsyy/SPlayer/commit/a1194232af4888bf7217ca35acc829a94d5a419a) log 怎么又忘删了 - [`ad807cf`](https://github.com/imsyy/SPlayer/commit/ad807cf4786d3f44c65c5fb94b47eb8de6d58158) chore: 规范代码 添加分号 ### 📊 Changes **7 files changed** (+160 additions, -39 deletions) <details> <summary>View changed files</summary> 📝 `electron/main/ipcMain.ts` (+35 -14) 📝 `src/components/Setting/LocalSetting.vue` (+36 -3) 📝 `src/stores/setting.ts` (+3 -0) 📝 `src/utils/helper.ts` (+50 -16) 📝 `src/utils/lyric.ts` (+23 -2) 📝 `src/utils/player-utils/lyric.ts` (+11 -2) 📝 `src/utils/player.ts` (+2 -2) </details> ### 📄 Description - 本地音乐优先使用外部歌词而非音乐内封歌词 因为个人认为内封的歌词不好取出,而单独文件的歌词可以更好地移除和修改,所以单独文件的歌词优先级高于内封歌词 - 支持本地 TTML 歌词,将同名 .ttml 文件放在此音乐相同位置即可 - 支持从本地特定位置读取 .lrc 和 .ttml 歌词覆盖线上歌词 因为部分线上歌词质量低劣,可以自己修改以获得更好观感,也可以尝试 AMLL TTML DB 中尚未被合并的歌词 ## 修改 ### 本地音乐歌词的修改 Commit 信息里的 TTML 手快打错了,不要在意( 修改了 `ipcMain.ts` 中的 `get-music-lyric` 和 `lyric.ts` 中的 `parseLocalLyric` 使其支持 ttml 的同时提高从文件读取歌词的优先级,`player.ts` 中的调用也跟着改了 ### 支持从本地读取歌词覆盖线上歌词 - 增加了 `localLyricPath` 设置项 这个设置项和 `localFilesPath` 很像,因此为了减少代码重合,重构了 `helper.ts` 中的 `changeLocalPath` 使其可以应对更多情况 - 在 `ipcMain.ts` 中增加 `read-local-lyric` 以使用路径、歌曲ID、扩展名读取覆盖的歌词文件 - 在 `lyric.ts` 中获取线上歌词前先调用 `read-local-lyric` 获取本地的覆盖歌词 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 07:12:02 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SPlayer#487
No description provided.