This commit is contained in:
@@ -2063,14 +2063,13 @@ function updatePopulateProgress(status) {
|
||||
progressText.textContent = 'Complete!';
|
||||
}
|
||||
|
||||
// Show results (API returns movies/tv directly, not nested in result)
|
||||
// Show results (API returns movies/tv with nested stats)
|
||||
if (resultsDiv && (status.movies || status.tv)) {
|
||||
const result = status; // Use status directly, not status.result
|
||||
let html = '<h4>Population Results</h4>';
|
||||
|
||||
// Movies
|
||||
if (result.movies) {
|
||||
const m = result.movies;
|
||||
if (status.movies && status.movies.stats) {
|
||||
const m = status.movies.stats;
|
||||
html += '<div class="populate-section">';
|
||||
html += '<h5><i class="fas fa-film"></i> Movies</h5>';
|
||||
html += '<ul>';
|
||||
@@ -2080,12 +2079,20 @@ function updatePopulateProgress(status) {
|
||||
html += `<li>Errors: ${m.errors || 0}</li>`;
|
||||
html += `<li>Duration: ${(m.duration || 0).toFixed(2)}s</li>`;
|
||||
html += '</ul>';
|
||||
// Show skipped items if any
|
||||
if (m.skipped_items && m.skipped_items.length > 0) {
|
||||
html += '<details style="margin-top: 10px;"><summary>Skipped Movies (' + m.skipped_items.length + ')</summary><ul>';
|
||||
m.skipped_items.forEach(item => {
|
||||
html += `<li><strong>${item.title || 'Unknown'}</strong> (${item.year || 'N/A'}) [${item.imdb_id || 'No IMDb'}] - ${item.reason}</li>`;
|
||||
});
|
||||
html += '</ul></details>';
|
||||
}
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
// TV Episodes
|
||||
if (result.tv) {
|
||||
const tv = result.tv;
|
||||
if (status.tv && status.tv.stats) {
|
||||
const tv = status.tv.stats;
|
||||
html += '<div class="populate-section">';
|
||||
html += '<h5><i class="fas fa-tv"></i> TV Shows</h5>';
|
||||
html += '<ul>';
|
||||
@@ -2096,14 +2103,17 @@ function updatePopulateProgress(status) {
|
||||
html += `<li>Errors: ${tv.errors || 0}</li>`;
|
||||
html += `<li>Duration: ${(tv.duration || 0).toFixed(2)}s</li>`;
|
||||
html += '</ul>';
|
||||
// Show skipped items if any
|
||||
if (tv.skipped_items && tv.skipped_items.length > 0) {
|
||||
html += '<details style="margin-top: 10px;"><summary>Skipped Episodes (' + tv.skipped_items.length + ')</summary><ul>';
|
||||
tv.skipped_items.forEach(item => {
|
||||
html += `<li><strong>${item.title || 'Unknown'}</strong> S${String(item.season).padStart(2,'0')}E${String(item.episode).padStart(2,'0')} - ${item.reason}</li>`;
|
||||
});
|
||||
html += '</ul></details>';
|
||||
}
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
// Total duration
|
||||
if (result.total_duration) {
|
||||
html += `<p><strong>Total Duration:</strong> ${result.total_duration.toFixed(2)}s</p>`;
|
||||
}
|
||||
|
||||
resultsDiv.innerHTML = html;
|
||||
resultsDiv.style.display = 'block';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user