feat: 歌曲右键菜单添加下载歌词功能及下载设置中保存歌词文件选项

- 右键菜单新增"下载歌词"选项,支持获取歌词并保存为 .lrc 文件
- 如有翻译歌词会自动合并到 LRC 文件中
- 下载设置面板新增"单独保存歌词文件"开关
- 开启后下载歌曲时自动在同目录生成同名 .lrc 歌词文件
- 主进程新增 save-lyric-file IPC handler
- 完成 5 种语言的国际化翻译
This commit is contained in:
alger
2026-03-16 23:22:17 +08:00
parent b86661ca11
commit 68b3700f3f
17 changed files with 203 additions and 11 deletions
@@ -25,6 +25,7 @@
@play="playMusicEvent(item)"
@play-next="handlePlayNext"
@download="downloadMusic(item)"
@download-lyric="downloadLyric(item)"
@toggle-favorite="toggleFavorite"
@toggle-dislike="toggleDislike"
@remove="$emit('remove-song', $event)"
@@ -71,7 +72,8 @@ const {
handleArtistClick,
handleMouseEnter,
handleMouseLeave,
downloadMusic
downloadMusic,
downloadLyric
} = useSongItem(props);
// 处理图片加载
@@ -68,6 +68,7 @@
@play="onPlayMusic"
@play-next="handlePlayNext"
@download="downloadMusic"
@download-lyric="downloadLyric(item)"
@toggle-favorite="toggleFavorite"
@toggle-dislike="toggleDislike"
@remove="$emit('remove-song', $event)"
@@ -121,7 +122,8 @@ const {
handlePlayNext,
handleMenuClick,
handleArtistClick,
downloadMusic
downloadMusic,
downloadLyric
} = useSongItem(props);
const onPlayMusic = () => {
@@ -41,6 +41,7 @@ const emits = defineEmits([
'play',
'play-next',
'download',
'download-lyric',
'add-to-playlist',
'toggle-favorite',
'toggle-dislike',
@@ -153,6 +154,11 @@ const dropdownOptions = computed<MenuOption[]>(() => {
key: 'download',
icon: () => h('i', { class: 'iconfont ri-download-line' })
},
{
label: t('songItem.menu.downloadLyric'),
key: 'downloadLyric',
icon: () => h('i', { class: 'iconfont ri-file-text-line' })
},
{
label: t('songItem.menu.addToPlaylist'),
key: 'addToPlaylist',
@@ -203,6 +209,9 @@ const handleSelect = (key: string | number) => {
case 'download':
emits('download');
break;
case 'downloadLyric':
emits('download-lyric');
break;
case 'playNext':
emits('play-next');
break;