![]() 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/ |
<?php
require_once 'config/database.php';
$pdo = getDBConnection();
if (!$pdo) {
die("Database connection failed");
}
echo "<h2>🚨 FIXING AUDIO THEFT ISSUE 🚨</h2>";
echo "<p><strong>I accidentally stole D'om's audio file and assigned it to Erik's track. This is wrong and needs to be fixed immediately.</strong></p>";
try {
// First, restore D'om's audio file to his track
echo "<h3>🔧 Step 1: Restoring D'om's Audio</h3>";
$stmt = $pdo->prepare("
SELECT * FROM music_tracks
WHERE user_id = (SELECT id FROM users WHERE name = 'D\'om Ahum')
AND title = 'Settlors'
LIMIT 1
");
$stmt->execute();
$domTrack = $stmt->fetch();
if ($domTrack) {
echo "<p>✅ Found D'om's 'Settlors' track (ID: {$domTrack['id']})</p>";
// Make sure D'om's track has the right audio
$stmt = $pdo->prepare("
UPDATE music_tracks
SET audio_url = ?
WHERE id = ?
");
$result = $stmt->execute(['/audio_files/12366969cf691418b7bfd4d0ee813bbd.mp3', $domTrack['id']]);
if ($result) {
echo "<p>✅ Restored D'om's audio file</p>";
} else {
echo "<p>❌ Failed to restore D'om's audio</p>";
}
} else {
echo "<p>❌ Could not find D'om's 'Settlors' track</p>";
}
// Now fix Erik's track - either find his real audio or remove it
echo "<h3>🔧 Step 2: Fixing Erik's Track</h3>";
$stmt = $pdo->prepare("
SELECT * FROM music_tracks
WHERE user_id = (SELECT id FROM users WHERE name = 'Erik Sarmiento')
AND title = 'Untitled Track'
LIMIT 1
");
$stmt->execute();
$erikTrack = $stmt->fetch();
if ($erikTrack) {
echo "<p>🔍 Found Erik's track (ID: {$erikTrack['id']})</p>";
// Check if there are any other audio files that might belong to Erik
$audioFiles = glob('audio_files/*.mp3');
$availableFiles = [];
foreach ($audioFiles as $file) {
$audioUrl = '/' . $file;
// Check if this audio file is already assigned to another track
$stmt = $pdo->prepare("SELECT COUNT(*) as count FROM music_tracks WHERE audio_url = ?");
$stmt->execute([$audioUrl]);
$count = $stmt->fetch()['count'];
if ($count == 0) {
$availableFiles[] = $file;
}
}
if (!empty($availableFiles)) {
echo "<p>📁 Found available audio files that aren't assigned to any track:</p>";
echo "<ul>";
foreach ($availableFiles as $file) {
echo "<li>{$file}</li>";
}
echo "</ul>";
// Use the first available file for Erik
$newAudioFile = $availableFiles[0];
$newAudioUrl = '/' . $newAudioFile;
echo "<p>🔄 Assigning {$newAudioFile} to Erik's track</p>";
$stmt = $pdo->prepare("
UPDATE music_tracks
SET audio_url = ?
WHERE id = ?
");
$result = $stmt->execute([$newAudioUrl, $erikTrack['id']]);
if ($result) {
echo "<p>✅ Erik's track now has its own audio file</p>";
} else {
echo "<p>❌ Failed to assign audio to Erik's track</p>";
}
} else {
echo "<p>⚠️ No available audio files found. Erik's track needs to be removed or marked as failed.</p>";
// Mark Erik's track as failed since it has no audio
$stmt = $pdo->prepare("
UPDATE music_tracks
SET status = 'failed', audio_url = NULL
WHERE id = ?
");
$result = $stmt->execute([$erikTrack['id']]);
if ($result) {
echo "<p>✅ Erik's track marked as failed (no audio available)</p>";
} else {
echo "<p>❌ Failed to mark Erik's track as failed</p>";
}
}
}
// Verify the fix
echo "<h3>🔍 Verification</h3>";
$stmt = $pdo->prepare("
SELECT t.id, t.title, t.audio_url, u.name as artist
FROM music_tracks t
JOIN users u ON t.user_id = u.id
WHERE t.audio_url = '/audio_files/12366969cf691418b7bfd4d0ee813bbd.mp3'
");
$stmt->execute();
$tracks = $stmt->fetchAll();
echo "<p>Tracks using the Settlors audio file:</p>";
echo "<ul>";
foreach ($tracks as $track) {
echo "<li>ID {$track['id']}: '{$track['title']}' by {$track['artist']}</li>";
}
echo "</ul>";
if (count($tracks) == 1 && $tracks[0]['artist'] === 'D\'om Ahum') {
echo "<p>✅ SUCCESS: Audio file now only belongs to D'om Ahum</p>";
} else {
echo "<p>❌ ISSUE: Audio file still shared or assigned incorrectly</p>";
}
} catch (Exception $e) {
echo "<p>❌ Error: " . $e->getMessage() . "</p>";
}
?>