updated
This commit is contained in:
parent
144a8492d7
commit
fbe9f306a3
@ -6,7 +6,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -335,10 +334,6 @@ func runRegenerateAssetsJob(job *regenerateAssetsJob) {
|
|||||||
failJob := func(queue, phase, msg string) {
|
failJob := func(queue, phase, msg string) {
|
||||||
msg = strings.TrimSpace(msg)
|
msg = strings.TrimSpace(msg)
|
||||||
|
|
||||||
if msg != "" {
|
|
||||||
fmt.Printf("❌ regenerate-assets error file=%s queue=%s phase=%s error=%s\n", file, queue, phase, msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
if queue != "" && phase != "" {
|
if queue != "" && phase != "" {
|
||||||
publishFinishedPostworkPhase(file, id, queue, phase, "error", "Fehler", msg)
|
publishFinishedPostworkPhase(file, id, queue, phase, "error", "Fehler", msg)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2102,7 +2102,7 @@ export default function App() {
|
|||||||
if (alreadyRunning) return true
|
if (alreadyRunning) return true
|
||||||
|
|
||||||
// ✅ Nur Auto-/Silent-Starts: Chaturbate ggf. in Warteschlange statt Sofortstart
|
// ✅ Nur Auto-/Silent-Starts: Chaturbate ggf. in Warteschlange statt Sofortstart
|
||||||
if (silent && provider === 'chaturbate' && recSettingsRef.current.useChaturbateApi) {
|
if (provider === 'chaturbate' && recSettingsRef.current.useChaturbateApi) {
|
||||||
try {
|
try {
|
||||||
const parsed = await apiJSON<ParsedModel>('/api/models/parse', {
|
const parsed = await apiJSON<ParsedModel>('/api/models/parse', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -2712,10 +2712,7 @@ export default function App() {
|
|||||||
}, [playerJob, modelsByKey])
|
}, [playerJob, modelsByKey])
|
||||||
|
|
||||||
async function onStart() {
|
async function onStart() {
|
||||||
const ok = enqueueStart({
|
const ok = await startUrl(sourceUrl, { silent: false })
|
||||||
url: sourceUrl,
|
|
||||||
silent: false,
|
|
||||||
})
|
|
||||||
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
setSourceUrl('')
|
setSourceUrl('')
|
||||||
|
|||||||
@ -245,17 +245,26 @@ export default function RecorderSettings({ onAssetsGenerated }: Props) {
|
|||||||
assetsError.toLowerCase() === 'cancelled' ||
|
assetsError.toLowerCase() === 'cancelled' ||
|
||||||
assetsError.toLowerCase() === 'canceled'
|
assetsError.toLowerCase() === 'canceled'
|
||||||
|
|
||||||
setAssetsTask((t) => ({
|
setAssetsTask((t) => {
|
||||||
...t,
|
// Wenn schon idle oder bereits am Ausfaden: nicht wieder "sichtbar reaktivieren"
|
||||||
status: cancelled ? 'cancelled' : 'error',
|
if (cancelled && (t.status === 'idle' || t.fading)) {
|
||||||
title: 'Assets generieren',
|
return t
|
||||||
text: shortTaskFilename(String(assets.currentFile || assets.text || '')),
|
}
|
||||||
done: Number(assets.done ?? 0),
|
|
||||||
total: Number(assets.total ?? 0),
|
const next: TaskItem = {
|
||||||
err: cancelled ? undefined : assetsError,
|
...t,
|
||||||
cancellable: false,
|
status: cancelled ? 'cancelled' : 'error',
|
||||||
fading: false,
|
title: 'Assets generieren',
|
||||||
}))
|
text: shortTaskFilename(String(assets.currentFile || assets.text || '')),
|
||||||
|
done: Number(assets.done ?? 0),
|
||||||
|
total: Number(assets.total ?? 0),
|
||||||
|
err: cancelled ? undefined : assetsError,
|
||||||
|
cancellable: false,
|
||||||
|
fading: t.fading ?? false,
|
||||||
|
}
|
||||||
|
|
||||||
|
return next
|
||||||
|
})
|
||||||
} else if (assets?.text || assets?.finishedAt) {
|
} else if (assets?.text || assets?.finishedAt) {
|
||||||
setAssetsTask((t) => ({
|
setAssetsTask((t) => ({
|
||||||
...t,
|
...t,
|
||||||
@ -717,25 +726,35 @@ export default function RecorderSettings({ onAssetsGenerated }: Props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function cancelAssetsTask() {
|
async function cancelAssetsTask() {
|
||||||
const ac = assetsAbortRef.current
|
const ac = assetsAbortRef.current
|
||||||
assetsAbortRef.current = null
|
assetsAbortRef.current = null
|
||||||
|
|
||||||
// UI sofort
|
// UI sofort
|
||||||
setAssetsTask((t: TaskItem) => ({ ...t, status: 'cancelled', text: 'Abgebrochen.' }))
|
setAssetsTask((t: TaskItem) => ({
|
||||||
|
...t,
|
||||||
|
status: 'cancelled',
|
||||||
|
title: 'Assets generieren',
|
||||||
|
text: 'Abgebrochen.',
|
||||||
|
err: undefined,
|
||||||
|
cancellable: false,
|
||||||
|
fading: false,
|
||||||
|
}))
|
||||||
|
|
||||||
if (ac) {
|
fadeOutTask(setAssetsTask)
|
||||||
ac.abort()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fallback (z.B. nach Reload, wenn kein Controller existiert):
|
if (ac) {
|
||||||
try {
|
ac.abort()
|
||||||
await fetch('/api/tasks/generate-assets', { method: 'DELETE', cache: 'no-store' as any })
|
return
|
||||||
} catch {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fallback (z.B. nach Reload, wenn kein Controller existiert):
|
||||||
|
try {
|
||||||
|
await fetch('/api/tasks/generate-assets', { method: 'DELETE', cache: 'no-store' as any })
|
||||||
|
} catch {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function cancelRegenerateAssetsTask(file: string) {
|
async function cancelRegenerateAssetsTask(file: string) {
|
||||||
const cleanFile = String(file || '').trim()
|
const cleanFile = String(file || '').trim()
|
||||||
if (!cleanFile) return
|
if (!cleanFile) return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user