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>
|
</label>
|
||||||
</div>
|
</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>
|
<div id="indexStatus" class="fieldDescription" style="margin-bottom:1.5em;"></div>
|
||||||
|
|
||||||
<button is="emby-button" type="submit" class="raised button-submit block">
|
<button is="emby-button" type="submit" class="raised button-submit block">
|
||||||
@@ -108,11 +115,25 @@
|
|||||||
|
|
||||||
function renderStatus(status) {
|
function renderStatus(status) {
|
||||||
var container = page.querySelector('#indexStatus');
|
var container = page.querySelector('#indexStatus');
|
||||||
|
var progress = page.querySelector('#overallProgress');
|
||||||
|
var progressText = page.querySelector('#overallProgressText');
|
||||||
|
var progressItems = page.querySelector('#overallProgressItems');
|
||||||
|
|
||||||
if (!status) {
|
if (!status) {
|
||||||
container.textContent = 'Index status unavailable.';
|
container.textContent = 'Index status unavailable.';
|
||||||
|
progress.value = 0;
|
||||||
|
progressText.textContent = '0%';
|
||||||
|
progressItems.textContent = '0 / 0 items';
|
||||||
return;
|
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) {
|
if (status.running) {
|
||||||
var parts = ['Indexing'];
|
var parts = ['Indexing'];
|
||||||
if (status.library) {
|
if (status.library) {
|
||||||
|
|||||||
Reference in New Issue
Block a user