3 if ( isset($_GET['act']) && $_GET['act'] == 'no' && ( !isset($_POST['act']) ||
$_POST['act'] == 'no') ) return;
5 if ( isset($l) && isset($a) && isset($t) ) {
6 $qry = new AwlQuery( "SELECT path_name, hash_key FROM tracks WHERE album = ? AND artist = ? AND title = ? ", $l, $a, $t );
7 if ( $qry->Exec("PlayTracks") && $qry->rows() == 1 ) {
8 $track = $qry->Fetch();
9 PlayTrack( $track->path_name
, $track->hash_key
);
12 else if ( ( isset($a) ||
(isset($play) && $play > 0) ) && isset($l) ) {
13 // Play all of the tracks for this album
15 $qry = new AwlQuery( "SELECT path_name, hash_key FROM tracks WHERE album = ? AND artist = ? ORDER BY setpart, tracknum;", $l, $a );
17 $qry = new AwlQuery( "SELECT path_name, hash_key FROM tracks WHERE album = ? ORDER BY setpart, tracknum;", $l );
18 if ( $qry->Exec("PlayTracks") && $qry->rows() > 0 ) {
19 while( $track = $qry->Fetch() ) {
20 PlayTrack( $track->path_name
, $track->hash_key
);
24 else if ( ( isset($_POST['url']) && $_POST['act'] == 'Play URL' )
25 ||
( isset($_GET['url']) && $_GET['act'] == 'Play URL' ) ) {
26 $url = ( isset($_POST['url']) ?
$_POST['url'] : $_GET['url'] );
27 PlayTrack( $url, md5($url) );
29 // Attempt to update the database with the stream details
30 $sql = "SELECT 1 FROM streams WHERE stream_url = ?";
31 $qry = new AwlQuery( $sql, $url );
32 if ( $qry->rows() == 0 ) {
33 $sql = "INSERT INTO streams ( stream_url ) VALUES( ? )";
34 $qry = new AwlQuery( $sql, $url );
37 else if ( isset($_GET['i']) && isset($_GET['d']) ) {
38 daemon_move( intval($_GET['i']), (substr($_GET['d'],0,1) == 'd' ?
1 : -1) );