mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-20 00:33:36 +00:00
Show overall indexing progress in plugin
This commit is contained in:
@@ -60,6 +60,13 @@
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom:.5em;">
|
||||
<div style="display:flex;justify-content:space-between;gap:1em;">
|
||||
<strong id="overallProgressText">0%</strong>
|
||||
<span id="overallProgressItems" class="fieldDescription">0 / 0 items</span>
|
||||
</div>
|
||||
<progress id="overallProgress" max="100" value="0" style="width:100%;height:1.1em;"></progress>
|
||||
</div>
|
||||
<div id="indexStatus" class="fieldDescription" style="margin-bottom:1.5em;"></div>
|
||||
|
||||
<button is="emby-button" type="submit" class="raised button-submit block">
|
||||
@@ -108,11 +115,25 @@
|
||||
|
||||
function renderStatus(status) {
|
||||
var container = page.querySelector('#indexStatus');
|
||||
var progress = page.querySelector('#overallProgress');
|
||||
var progressText = page.querySelector('#overallProgressText');
|
||||
var progressItems = page.querySelector('#overallProgressItems');
|
||||
|
||||
if (!status) {
|
||||
container.textContent = 'Index status unavailable.';
|
||||
progress.value = 0;
|
||||
progressText.textContent = '0%';
|
||||
progressItems.textContent = '0 / 0 items';
|
||||
return;
|
||||
}
|
||||
|
||||
var percent = Number(status.overall_percent || (status.stage === 'complete' ? 100 : 0));
|
||||
progress.value = percent;
|
||||
progressText.textContent = percent.toFixed(1).replace('.0', '') + '%';
|
||||
progressItems.textContent =
|
||||
(status.overall_items_completed || 0) + ' / ' +
|
||||
(status.overall_items_total || 0) + ' items';
|
||||
|
||||
if (status.running) {
|
||||
var parts = ['Indexing'];
|
||||
if (status.library) {
|
||||
|
||||
Reference in New Issue
Block a user