![]() 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/.cursor-server/data/User/History/-59caa4f1/ |
<?php
require_once 'config/database.php';
echo "<h1>🔍 Debug Track ID 63</h1>";
try {
$pdo = getDBConnection();
// Get track ID 63 with all fields
$track_query = "
SELECT
mt.*,
u.name as artist_name
FROM music_tracks mt
JOIN users u ON mt.user_id = u.id
WHERE mt.id = 63
";
$stmt = $pdo->prepare($track_query);
$stmt->execute();
$track = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$track) {
echo "<p style='color: red;'>❌ Track ID 63 not found</p>";
exit;
}
echo "<h2>📊 Track Information</h2>";
echo "<table style='width: 100%; border-collapse: collapse; margin: 15px 0;'>";
echo "<tr style='background: #667eea; color: white;'>";
echo "<th style='padding: 10px; border: 1px solid #ccc;'>Field</th>";
echo "<th style='padding: 10px; border: 1px solid #ccc;'>Value</th>";
echo "</tr>";
foreach ($track as $field => $value) {
$row_color = ($field === 'lyrics') ? '#ffe8e8' : '#f9f9f9';
echo "<tr style='background: $row_color;'>";
echo "<td style='padding: 10px; border: 1px solid #ccc; font-weight: bold;'>$field</td>";
if ($field === 'lyrics') {
if (empty($value)) {
echo "<td style='padding: 10px; border: 1px solid #ccc; color: red;'>❌ NULL or empty</td>";
} else {
echo "<td style='padding: 10px; border: 1px solid #ccc; color: green;'>✅ Has data (" . strlen($value) . " chars)</td>";
}
} elseif ($field === 'metadata') {
$metadata = json_decode($value, true);
if ($metadata) {
echo "<td style='padding: 10px; border: 1px solid #ccc;'>JSON data (" . count($metadata) . " fields)</td>";
} else {
echo "<td style='padding: 10px; border: 1px solid #ccc;'>Invalid JSON or empty</td>";
}
} elseif (is_string($value) && strlen($value) > 100) {
echo "<td style='padding: 10px; border: 1px solid #ccc;'>Long text (" . strlen($value) . " chars) - " . substr($value, 0, 50) . "...</td>";
} else {
echo "<td style='padding: 10px; border: 1px solid #ccc;'>" . htmlspecialchars($value ?? 'NULL') . "</td>";
}
echo "</tr>";
}
echo "</table>";
// Special check for lyrics
echo "<h2>🎵 Lyrics Analysis</h2>";
if (empty($track['lyrics'])) {
echo "<p style='color: red; font-weight: bold;'>❌ Track ID 63 has NO lyrics in database</p>";
echo "<p>This means either:</p>";
echo "<ul>";
echo "<li>API.Box never sent lyrics for this track</li>";
echo "<li>The callback didn't extract them properly</li>";
echo "<li>The lyrics field is empty in the database</li>";
echo "</ul>";
} else {
echo "<p style='color: green; font-weight: bold;'>✅ Track ID 63 HAS lyrics in database</p>";
echo "<p><strong>Lyrics length:</strong> " . strlen($track['lyrics']) . " characters</p>";
echo "<p><strong>Lyrics preview:</strong></p>";
echo "<div style='background: #f0f0f0; padding: 15px; border-radius: 8px; margin: 10px 0;'>";
echo "<pre style='white-space: pre-wrap;'>" . htmlspecialchars($track['lyrics']) . "</pre>";
echo "</div>";
echo "<p><strong>If lyrics exist but aren't showing on track.php:</strong></p>";
echo "<ul>";
echo "<li>Check if track.php is loading the correct track</li>";
echo "<li>Verify the SQL query is working</li>";
echo "<li>Check for JavaScript errors</li>";
echo "</ul>";
}
// Check if this track has a task_id for API.Box sync
echo "<h2>🔗 API.Box Connection</h2>";
if (!empty($track['task_id'])) {
echo "<p style='color: green;'>✅ Has task_id: {$track['task_id']}</p>";
echo "<p>This track can be re-synced from API.Box to get lyrics if available.</p>";
} else {
echo "<p style='color: red;'>❌ No task_id found</p>";
echo "<p>This track cannot be re-synced from API.Box.</p>";
}
} catch (Exception $e) {
echo "<p style='color: red;'>❌ Error: " . htmlspecialchars($e->getMessage()) . "</p>";
}
echo "<hr>";
echo "<h2>🎯 Next Steps</h2>";
echo "<p>1. <strong>If no lyrics:</strong> Run sync to get them from API.Box</p>";
echo "<p>2. <strong>If lyrics exist:</strong> Check why track.php isn't displaying them</p>";
echo "<p>3. <strong>Test track page:</strong> Visit track.php?id=63 to see the issue</p>";
?>