This commit is contained in:
@@ -711,6 +711,6 @@
|
||||
<!-- Toast Notifications -->
|
||||
<div class="toast-container" id="toast-container"></div>
|
||||
|
||||
<script src="/static/js/app.js?v=2.9.5-populate-progress-fix"></script>
|
||||
<script src="/static/js/app.js?v=2.9.7-status-format-fix"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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 = '<h4>Population Results</h4>';
|
||||
|
||||
// Movies
|
||||
|
||||
Reference in New Issue
Block a user