diff --git a/VERSION b/VERSION index 6cc6ac3..79efce5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.9.6-populate-progress-fix +2.9.7-status-format-fix diff --git a/nfoguard-web/static/index.html b/nfoguard-web/static/index.html index a3e2fd1..265748c 100644 --- a/nfoguard-web/static/index.html +++ b/nfoguard-web/static/index.html @@ -711,6 +711,6 @@
- + \ No newline at end of file diff --git a/nfoguard-web/static/js/app.js b/nfoguard-web/static/js/app.js index 01eef39..ef39dfb 100644 --- a/nfoguard-web/static/js/app.js +++ b/nfoguard-web/static/js/app.js @@ -1857,8 +1857,8 @@ function startPopulatePolling() { const status = await response.json(); updatePopulateProgress(status); - // Stop polling if complete or error - if (status.status === 'completed' || status.status === 'error') { + // Stop polling if complete or error (API returns "completed": true/false and "error": string) + if (status.completed || status.error) { stopPopulatePolling(); // Re-enable submit button @@ -1895,7 +1895,8 @@ function updatePopulateProgress(status) { const progressText = document.getElementById('populate-progress-text'); const resultsDiv = document.getElementById('populate-results'); - if (status.status === 'in_progress') { + // Handle running status (API returns "running": true/false) + if (status.running && !status.completed) { if (progressBar) { // Show indeterminate progress progressBar.style.width = '50%'; @@ -1903,7 +1904,7 @@ function updatePopulateProgress(status) { if (progressText) { progressText.textContent = 'Populating database...'; } - } else if (status.status === 'completed') { + } else if (status.completed) { if (progressBar) { progressBar.style.width = '100%'; } @@ -1911,9 +1912,9 @@ function updatePopulateProgress(status) { progressText.textContent = 'Complete!'; } - // Show results - if (resultsDiv && status.result) { - const result = status.result; + // Show results (API returns movies/tv directly, not nested in result) + if (resultsDiv && (status.movies || status.tv)) { + const result = status; // Use status directly, not status.result let html = '

Population Results

'; // Movies