diff --git a/apps/music/frontend/src/views/EditView.vue b/apps/music/frontend/src/views/EditView.vue index 4995f54..eb21cd5 100644 --- a/apps/music/frontend/src/views/EditView.vue +++ b/apps/music/frontend/src/views/EditView.vue @@ -106,8 +106,7 @@ 角色 @@ -339,8 +338,6 @@ function kindLabel(k) { function roleLabel(r) { return ({ chord: '和弦谱', - chord_letters: '和弦谱', - chord_functional: '简谱', numbered: '简谱', staff: '五线谱', })[r] || r diff --git a/apps/music/frontend/src/views/PlayerView.vue b/apps/music/frontend/src/views/PlayerView.vue index 025645d..a732440 100644 --- a/apps/music/frontend/src/views/PlayerView.vue +++ b/apps/music/frontend/src/views/PlayerView.vue @@ -131,10 +131,10 @@ >{{ line.text }} - -
+ +
-

- 从 yopu.co 抓 和弦谱(字母 G/Em/C + 六线谱) - 从 yopu.co 抓 简谱(数字 1/4/5/6m 级数) +

+ 从 yopu.co 抓 和弦谱(歌词 + 数字级数 1/4/5/6m)

-

+

正在抓取,约 30-60s…

-

- 抓取失败:{{ chordErrors[modeForTab(activeTab)] }} +

+ 抓取失败:{{ chordErrors.chord }}

- -
+ +
a.kind === 'image' && set.has(a.role), + a => a.kind === 'image' && a.role === 'chord', ) } -function modeForTab(tab) { - return tab === 'functional' ? 'functional' : 'letters' +function modeForTab(_tab) { + return 'chord' // 唯一抓取模式 } const tabs = computed(() => { @@ -544,7 +539,8 @@ const tabs = computed(() => { const list = [] if (selected.value.lyrics) list.push({ key: 'lyrics', label: '歌词', count: 0 }) list.push({ key: 'chord', label: '和弦谱', count: chordTabAttachments('chord').length }) - list.push({ key: 'functional', label: '简谱', count: chordTabAttachments('functional').length }) + const num = roleAttachments('numbered').length + if (num) list.push({ key: 'numbered', label: '简谱(自传)', count: num }) const staff = roleAttachments('staff').length if (staff) list.push({ key: 'staff', label: '五线谱', count: staff }) if (pdfAttachments.value.length) list.push({ key: 'pdf', label: '乐谱 PDF', count: pdfAttachments.value.length }) @@ -662,9 +658,9 @@ async function promptNewPlaylist() { async function loadPiece(id) { selected.value = null notesDraft.value = '' - stopChordPoll('letters'); stopChordPoll('functional') - chordStates.value = { letters: 'idle', functional: 'idle' } - chordErrors.value = { letters: '', functional: '' } + stopChordPoll('chord') + chordStates.value = { chord: 'idle' } + chordErrors.value = { chord: '' } abortChat() chatMessages.value = [] chatStreamText.value = '' @@ -1002,7 +998,7 @@ onMounted(async () => { onBeforeUnmount(() => { document.removeEventListener('keydown', onKeyDown) if (notesTimer) clearTimeout(notesTimer) - stopChordPoll('letters'); stopChordPoll('functional') + stopChordPoll('chord') abortChat() }) diff --git a/apps/music/src/main.rs b/apps/music/src/main.rs index 9d8d5c9..d3283a5 100644 --- a/apps/music/src/main.rs +++ b/apps/music/src/main.rs @@ -1549,17 +1549,10 @@ async fn upload_attachments( ) -> Result, AppError> { let role = match q.role.as_deref().map(str::trim).filter(|s| !s.is_empty()) { None => None, - Some(r) - if matches!( - r, - "chord" | "chord_letters" | "chord_functional" | "numbered" | "staff" - ) => - { - Some(r.to_string()) - } + Some(r) if matches!(r, "chord" | "jianpu" | "numbered" | "staff") => Some(r.to_string()), Some(other) => { return Err(AppError::bad_request(format!( - "unsupported role '{other}', expect one of: chord / chord_letters / chord_functional / numbered / staff" + "unsupported role '{other}', expect one of: chord / jianpu / numbered / staff" ))); } };