This commit is contained in:
@@ -1567,7 +1567,39 @@ async function checkScanStatus() {
|
||||
const status = await apiCall('/api/scan/status');
|
||||
|
||||
if (status.scanning) {
|
||||
updateScanStatus(status.message || 'Scan in progress...', true);
|
||||
// Build detailed status message from core container data
|
||||
let message = status.message || 'Scan in progress...';
|
||||
|
||||
// Add progress details if available
|
||||
if (status.current_operation === 'tv' && status.tv_series_total > 0) {
|
||||
const progress = `${status.tv_series_processed}/${status.tv_series_total}`;
|
||||
message = `Processing TV series (${progress})`;
|
||||
if (status.current_item) {
|
||||
message += ` | Current: ${status.current_item}`;
|
||||
}
|
||||
if (status.elapsed_seconds) {
|
||||
const elapsed = formatElapsedTime(status.elapsed_seconds);
|
||||
message += ` | ${elapsed} elapsed`;
|
||||
}
|
||||
} else if (status.current_operation === 'movies' && status.movies_total > 0) {
|
||||
const progress = `${status.movies_processed}/${status.movies_total}`;
|
||||
message = `Processing movies (${progress})`;
|
||||
if (status.current_item) {
|
||||
message += ` | Current: ${status.current_item}`;
|
||||
}
|
||||
if (status.elapsed_seconds) {
|
||||
const elapsed = formatElapsedTime(status.elapsed_seconds);
|
||||
message += ` | ${elapsed} elapsed`;
|
||||
}
|
||||
} else if (status.elapsed_seconds) {
|
||||
const elapsed = formatElapsedTime(status.elapsed_seconds);
|
||||
message = `Scan in progress | ${elapsed} elapsed`;
|
||||
if (status.current_item) {
|
||||
message += ` | Current: ${status.current_item}`;
|
||||
}
|
||||
}
|
||||
|
||||
updateScanStatus(message, true);
|
||||
|
||||
// Start polling if not already polling
|
||||
if (!scanStatusInterval) {
|
||||
@@ -1586,6 +1618,16 @@ async function checkScanStatus() {
|
||||
}
|
||||
}
|
||||
|
||||
function formatElapsedTime(seconds) {
|
||||
if (seconds >= 60) {
|
||||
const minutes = Math.floor(seconds / 60);
|
||||
const remainingSeconds = seconds % 60;
|
||||
return `${minutes}m ${remainingSeconds}s`;
|
||||
} else {
|
||||
return `${seconds}s`;
|
||||
}
|
||||
}
|
||||
|
||||
function startScanStatusPolling() {
|
||||
// Don't start if already polling
|
||||
if (scanStatusInterval) {
|
||||
|
||||
Reference in New Issue
Block a user