Add support for using mpd as a backend music-playing
[adorno.git] / inc / PlayTracks.php
bloba562cc5bd1ed98b8a9a4a04bf19ddd72a0eabd7d
1 <?php
3 if ( isset($_GET['act']) && $_GET['act'] == 'no' ) return;
5 if ( isset($l) && isset($a) && isset($t) ) {
6 $qry = new PgQuery( "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 alum
14 if ( isset($a) )
15 $qry = new PgQuery( "SELECT path_name, hash_key FROM tracks WHERE album = ? AND artist = ? ORDER BY setpart, tracknum;", $l, $a );
16 else
17 $qry = new PgQuery( "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 );