Fix Repair checks. Handle false positives
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user