type == ".flac") { $song->type = ".ogg"; }
if ($GLOBALS['user']->prefs['play_type'] == 'downsample') {
$ds = $GLOBALS['user']->prefs['sample_rate'];
}
$song_url = conf('web_path') . "/play/index.php?song=$song_id&uid=" . $GLOBALS['user']->id . "&sid=$sess_id&ds=$ds&name=." . $song->type;
if (is_null( $myMpd->PlAdd($song_url) ) ) {
$log_line = _("Error") . ": " . _("Could not add") . ": " . $song_url . " : " . $myMpd->errStr;
echo "$log_line
\n";
log_event($GLOBALS['user']->username,'add',$log_line);
} // if it's null
} // if we want urls
else {
$song = new Song( $song_id );
$song_filename = $song->get_rel_path();
if( is_null( $myMpd->PLAdd( $song_filename ) ) ) {
$log_line = _("Error") . ": " . _("Could not add") . ": " . $song_filename . " : " . $myMpd->errStr;
echo "$log_line
\n";
log_event($_SESSION['userdata']['username'],'add',$log_line);
} // end if it's null
// We still need to count if they use the file method
else {
$GLOBALS['user']->update_stats( $song_id );
} // end else
} // end else not url method
} // end foreach
} // addToPlaylist
/*!
@function show_mpd_control
@discussion shows the mpd controls
*/
function show_mpd_control() {
$_REQUEST['action'] = 'show_control';
require_once ('amp-mpd.php');
} // show_mpd_control
?>