mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-17 23:41:28 +00:00
Make caption startup responsive
This commit is contained in:
@@ -363,20 +363,29 @@
|
||||
$('captionFrames').textContent = (s.frames_completed || 0) + ' / ' + (s.frames_total || 0) + ' frames';
|
||||
|
||||
if (s.running) {
|
||||
const starting = s.stage === 'starting';
|
||||
const syncing = s.stage === 'syncing' || s.stage === 'sync';
|
||||
const stopping = !!s.stop_requested;
|
||||
$('captionNow').disabled = syncing || stopping;
|
||||
$('captionNow').textContent = syncing
|
||||
$('captionNow').disabled = starting || syncing || stopping;
|
||||
$('captionNow').textContent = starting
|
||||
? 'Starting...'
|
||||
: (syncing
|
||||
? 'Finishing...'
|
||||
: (stopping
|
||||
? 'Stopping...'
|
||||
: ((s.paused || s.pause_requested) ? 'Resume' : 'Pause'));
|
||||
: ((s.paused || s.pause_requested) ? 'Resume' : 'Pause')));
|
||||
$('captionStop').disabled = syncing || stopping;
|
||||
$('forceCaption').disabled = true;
|
||||
$('captionStatus').className = 'status';
|
||||
if (stopping) {
|
||||
$('captionStatus').textContent = 'Stop requested; finishing the current frame';
|
||||
$('captionStatus').textContent = starting
|
||||
? 'Stop requested; finishing preparation'
|
||||
: 'Stop requested; finishing the current frame';
|
||||
$('captionDetail').textContent = s.title || '';
|
||||
} else if (starting) {
|
||||
$('captionStatus').textContent = 'Starting captioning';
|
||||
$('captionDetail').textContent =
|
||||
s.preparing || 'Preparing caption job...';
|
||||
} else if (s.paused) {
|
||||
$('captionStatus').textContent = 'Captioning paused';
|
||||
$('captionDetail').textContent =
|
||||
@@ -465,6 +474,14 @@
|
||||
return;
|
||||
}
|
||||
try {
|
||||
$('captionNow').disabled = true;
|
||||
$('captionNow').textContent = 'Starting...';
|
||||
$('captionStop').disabled = true;
|
||||
$('forceCaption').disabled = true;
|
||||
$('captionStatus').className = 'status';
|
||||
$('captionStatus').textContent = 'Starting captioning';
|
||||
$('captionDetail').textContent = 'Sending start request...';
|
||||
|
||||
const s = await api('/api/caption', {
|
||||
method:'POST',
|
||||
body:JSON.stringify({library_ids:ids, force:$('forceCaption').checked})
|
||||
|
||||
Reference in New Issue
Block a user