Fix Repair checks. Handle false positives

This commit is contained in:
Mukhtar Akere
2025-01-23 01:35:28 +01:00
parent 74a55149fc
commit 0b1c1af8b8
5 changed files with 104 additions and 37 deletions

View File

@@ -76,7 +76,7 @@
function getStateColor(state) {
const stateColors = {
'downloading': 'bg-primary',
'pausedUP': 'bg-success',
'pausedup': 'bg-success',
'error': 'bg-danger',
};
return stateColors[state?.toLowerCase()] || 'bg-secondary';

View File

@@ -59,7 +59,7 @@
submitBtn.disabled = true;
submitBtn.innerHTML = '<span class="spinner-border spinner-border-sm me-2"></span>Repairing...';
let mediaIds = document.getElementById('mediaIds').value.split(',').map(id => id.trim());
try {
const response = await fetch('/internal/repair', {
method: 'POST',
@@ -68,7 +68,7 @@
},
body: JSON.stringify({
arr: document.getElementById('arrSelect').value,
mediaIds: document.getElementById('mediaIds').value.split(',').map(id => id.trim()),
mediaIds: mediaIds,
async: document.getElementById('isAsync').checked
})
});
@@ -77,7 +77,6 @@
const result = await response.json();
alert('Repair process initiated successfully!');
document.getElementById('mediaIds').value = '';
} catch (error) {
alert(`Error starting repair: ${error.message}`);
} finally {