| 4 | export let TRACK_NAMES = ["original", ...STEM_NAMES]; |
| 5 | |
| 6 | export async function syncStemNamesFromAPI() { |
| 7 | try { |
| 8 | const res = await fetch("/api/config"); |
| 9 | if (!res.ok) return; |
| 10 | const data = await res.json(); |
| 11 | if (Array.isArray(data.stem_names) && data.stem_names.length > 0) { |
| 12 | STEM_NAMES = data.stem_names; |
| 13 | TRACK_NAMES = ["original", ...STEM_NAMES]; |
| 14 | } |
| 15 | } catch (e) { |
| 16 | console.warn("[constants] failed to sync stem names from API:", e); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | export const STEM_DISPLAY = { |
| 21 | vocals: "Vocals", |