![]() 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/16615f5/ |
<?php
// Fix the audio URL to use the actual API.box URL
session_start();
// Enable error reporting
error_reporting(E_ALL);
ini_set('display_errors', 1);
echo "š§ FIXING AUDIO URL FOR ANDREW'S TRACK\n\n";
// Include database configuration
require_once 'config/database.php';
$pdo = getDBConnection();
if (!$pdo) {
echo "ā Database connection failed\n";
exit;
}
$taskId = '8cd1c23483097cc26fac73049ea0302d';
// Check current track status
$stmt = $pdo->prepare("SELECT * FROM music_tracks WHERE task_id = ?");
$stmt->execute([$taskId]);
$track = $stmt->fetch();
if (!$track) {
echo "ā Track not found in database\n";
exit;
}
echo "š CURRENT TRACK STATUS:\n";
echo "Task ID: " . $track['task_id'] . "\n";
echo "Title: " . $track['title'] . "\n";
echo "Status: " . $track['status'] . "\n";
echo "Audio URL: " . $track['audio_url'] . "\n";
echo "Duration: " . $track['duration'] . "\n\n";
// Get the actual API.box URL from task results
$resultFile = "task_results/{$taskId}.json";
if (file_exists($resultFile)) {
$resultData = json_decode(file_get_contents($resultFile), true);
if ($resultData && isset($resultData['data']['data'])) {
$audioData = $resultData['data']['data'];
// Get the first audio file with a valid URL
$actualAudioUrl = null;
foreach ($audioData as $audio) {
if (!empty($audio['audio_url'])) {
$actualAudioUrl = $audio['audio_url'];
break;
}
}
if ($actualAudioUrl) {
echo "šµ FOUND ACTUAL AUDIO URL:\n";
echo "API.box URL: " . $actualAudioUrl . "\n\n";
// Update the track with the actual API.box URL
$stmt = $pdo->prepare("
UPDATE music_tracks
SET audio_url = ?,
updated_at = NOW()
WHERE task_id = ?
");
$result = $stmt->execute([$actualAudioUrl, $taskId]);
if ($result) {
echo "ā
Track updated successfully!\n";
echo "New audio URL: " . $actualAudioUrl . "\n\n";
// Verify the update
$stmt = $pdo->prepare("SELECT * FROM music_tracks WHERE task_id = ?");
$stmt->execute([$taskId]);
$updatedTrack = $stmt->fetch();
echo "š UPDATED TRACK STATUS:\n";
echo "Task ID: " . $updatedTrack['task_id'] . "\n";
echo "Title: " . $updatedTrack['title'] . "\n";
echo "Status: " . $updatedTrack['status'] . "\n";
echo "Audio URL: " . $updatedTrack['audio_url'] . "\n";
echo "Duration: " . $updatedTrack['duration'] . "\n";
echo "Updated: " . $updatedTrack['updated_at'] . "\n\n";
echo "šµ TRACK SHOULD NOW BE PLAYABLE!\n";
echo "ā
Status: complete\n";
echo "ā
Audio URL: direct API.box URL\n";
echo "ā
Duration: " . $updatedTrack['duration'] . " seconds\n";
echo "ā
Ready for playback\n\n";
echo "š TEST THE TRACK:\n";
echo "Direct API.box URL: " . $actualAudioUrl . "\n";
echo "Audiofiles.php URL: https://soundstudiopro.com/audiofiles.php?id=" . $taskId . "\n";
echo "Library page: https://soundstudiopro.com/library_new.php\n";
} else {
echo "ā Failed to update track\n";
$error = $stmt->errorInfo();
echo "Error: " . $error[2] . "\n";
}
} else {
echo "ā No valid audio URL found in task results\n";
}
} else {
echo "ā Invalid task results format\n";
}
} else {
echo "ā Task results file not found: " . $resultFile . "\n";
}
echo "\nš AUDIO URL FIX COMPLETE!\n";
?>