Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/Setting/LyricsSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@
</n-card>
<n-card class="set-item">
<div class="label">
<n-text class="name">启用 TTML 歌词</n-text>
<n-text class="name">启用在线 TTML 歌词</n-text>
<n-text class="tip" :depth="3">
是否启用 TTML 歌词(如有),TTML 歌词支持逐字、翻译、音译等功能, 将会在下一首歌生效
是否从 AMLL TTML DB 获取歌词(如有),TTML 歌词支持逐字、翻译、音译等功能将会在下一首歌生效
</n-text>
</div>
<n-switch v-model:value="settingStore.enableTTMLLyric" class="set" :round="false" />
Expand Down
2 changes: 1 addition & 1 deletion src/stores/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ interface SettingState {
useAMLyrics: boolean;
/** 是否使用 AM 歌词弹簧效果 */
useAMSpring: boolean;
/** 是否启用 TTML 歌词 */
/** 是否启用在线 TTML 歌词 */
enableTTMLLyric: boolean;
/** 菜单显示封面 */
menuShowCover: boolean;
Expand Down
6 changes: 3 additions & 3 deletions src/utils/player-utils/lyric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const getLyricData = async (id: number) => {
const getLyric = getLyricFun(settingStore.localLyricPath, id);
const [lyricRes, ttmlContent] = await Promise.all([
getLyric("lrc", songLyric),
settingStore.enableTTMLLyric && getLyric("ttml", songLyricTTML),
settingStore.enableTTMLLyric ? getLyric("ttml", songLyricTTML) : getLyric("ttml"),
]);
parsedLyricsData(lyricRes);
if (ttmlContent) {
Expand Down Expand Up @@ -64,11 +64,11 @@ const getLyricFun =
(paths: string[], id: number) =>
async (
ext: string,
getOnline: (id: number) => Promise<string | null>,
getOnline?: (id: number) => Promise<string | null>,
): Promise<string | null> => {
for (const path of paths) {
const lyric = await window.electron.ipcRenderer.invoke("read-local-lyric", path, id, ext);
if (lyric) return lyric;
}
return await getOnline(id);
return getOnline ? await getOnline(id) : null;
};