![]()
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"
)));
}
};