Fix multiple issues: format API, Gradio availability, storage, UI responsiveness

- Format endpoint now calls ACE-Step /format_input REST API directly instead of
  spawning Python, fixing ENOENT errors on Windows (#44, #27, #34)
- isGradioAvailable() tries /gradio_api/info, /info, / in sequence to handle
  Gradio 4.x/5.x/6.x version differences, fixing generation fallback (#53, #20)
- Storage getUrl/getPublicUrl normalize /audio/ prefix to prevent double-prefix
  URLs when reference tracks are used for cover generation (#10)
- Gradio args: fix normalization_db default from 0.0 to -1.0 (Gradio default)
- Volume popover: add 400ms delay before hiding to prevent accidental dismissal (#51)
- Polling: skip setSongs state update when nothing changed to reduce re-renders (#51)
- FFmpeg: add jsdelivr CDN fallback when unpkg fails (#30)
- Model switching: add switchModelIfNeeded() via /v1/init REST API (#45)
This commit is contained in:
fspecii
2026-03-02 17:43:53 +02:00
parent 553e0bce2f
commit e1625a717d
7 changed files with 208 additions and 63 deletions
+14 -10
View File
@@ -707,17 +707,21 @@ function AppContent() {
? (Number(status.progress) > 1 ? Number(status.progress) / 100 : Number(status.progress))
: undefined;
setSongs(prev => prev.map(s => {
if (s.id === tempId) {
return {
...s,
queuePosition: status.status === 'queued' ? status.queuePosition : undefined,
progress: normalizedProgress ?? s.progress,
stage: status.stage ?? s.stage,
};
setSongs(prev => {
const song = prev.find(s => s.id === tempId);
if (!song) return prev;
const newQueuePos = status.status === 'queued' ? status.queuePosition : undefined;
const newProgress = normalizedProgress ?? song.progress;
const newStage = status.stage ?? song.stage;
// Skip update if nothing changed to avoid unnecessary re-renders
if (newProgress === song.progress && newStage === song.stage && newQueuePos === song.queuePosition) {
return prev;
}
return s;
}));
return prev.map(s => {
if (s.id !== tempId) return s;
return { ...s, queuePosition: newQueuePos, progress: newProgress, stage: newStage };
});
});
if (status.status === 'succeeded' && status.result) {
cleanupJob(jobId, tempId);