#!/opt/local/bin/php getId($artist_name); if (!$artist_id) { echo "Bad artist name!\n\n\n"; die; } $albums = $rg_model->getArtistAlbums($artist_id); $release_groups = $r_model->getReleases(array_keys($albums), true); $g_tracks = array(); foreach ($release_groups as $release_group => $releases) { $g_tracks[$release_group] = $t_model->getUniqueReleaseTracks(array_keys($releases)); } foreach($g_tracks as $release_group => $tracks) { $tracks = $tracks['tracks'] + $tracks['bonus']; foreach ($tracks as $track) { $track_id = $track['id']; $track_title = addslashes($artist_name .' - '. $track['name']); $track_length = $track['length']; $q = "INSERT INTO beathaven.queue VALUES({$track_id}, 0, E'{$track_title}', {$track_length});"; echo $q."\n"; $db->q($q); } }