![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/soundstudiopro.com/private_html/ |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fix Existing Tracks</title>
<style>
body { font-family: Arial, sans-serif; padding: 20px; background: #1a1a2e; color: #e8e8e8; }
.container { max-width: 800px; margin: 0 auto; }
.status { padding: 15px; margin: 10px 0; border-radius: 8px; }
.success { background: #27ae60; color: white; }
.error { background: #e74c3c; color: white; }
.info { background: #3498db; color: white; }
.warning { background: #f39c12; color: white; }
.btn { background: #667eea; color: white; border: none; padding: 12px 24px; border-radius: 5px; cursor: pointer; font-size: 16px; }
.btn:hover { background: #5a6fd8; }
.log { background: #0f0f23; padding: 15px; border-radius: 5px; font-family: monospace; font-size: 12px; max-height: 400px; overflow-y: auto; margin: 10px 0; }
</style>
</head>
<body>
<div class="container">
<h1>🔧 Fix Existing Tracks</h1>
<div id="status"></div>
<div id="log" class="log"></div>
<button class="btn" onclick="fixTracks()">Fix All Processing Tracks</button>
<button class="btn" onclick="checkStatus()">Check Current Status</button>
<script>
function log(message) {
const logElement = document.getElementById('log');
const timestamp = new Date().toLocaleTimeString();
logElement.innerHTML += `[${timestamp}] ${message}<br>`;
logElement.scrollTop = logElement.scrollHeight;
}
function showStatus(message, type = 'info') {
const statusElement = document.getElementById('status');
statusElement.innerHTML = `<div class="status ${type}">${message}</div>`;
}
async function checkStatus() {
showStatus('Checking current track status...', 'info');
log('🔍 Checking current track status...');
try {
const response = await fetch('fix_tracks_api.php?action=status');
const data = await response.json();
if (data.success) {
let statusHtml = '<h3>Current Track Status:</h3>';
data.statuses.forEach(status => {
statusHtml += `<p><strong>${status.status}:</strong> ${status.count} tracks</p>`;
});
showStatus(statusHtml, 'info');
log('📊 Status check completed');
} else {
showStatus('Failed to check status', 'error');
log('❌ Status check failed');
}
} catch (error) {
showStatus('Error checking status: ' + error.message, 'error');
log('❌ Error: ' + error.message);
}
}
async function fixTracks() {
showStatus('Fixing processing tracks...', 'warning');
log('🔧 Starting track fix process...');
try {
const response = await fetch('fix_tracks_api.php?action=fix');
const data = await response.json();
if (data.success) {
showStatus(`✅ Successfully fixed ${data.fixed_count} tracks!`, 'success');
log(`✅ Fixed ${data.fixed_count} tracks from processing to complete status`);
// Show updated status
setTimeout(checkStatus, 1000);
} else {
showStatus('Failed to fix tracks: ' + data.message, 'error');
log('❌ Fix failed: ' + data.message);
}
} catch (error) {
showStatus('Error fixing tracks: ' + error.message, 'error');
log('❌ Error: ' + error.message);
}
}
// Auto-check status on page load
window.addEventListener('load', () => {
setTimeout(checkStatus, 500);
});
</script>
</div>
</body>
</html>