From d7fdcb6d73aff127f6d8c394c48c571937a21df6 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sun, 28 Dec 2008 17:27:29 +1300 Subject: [PATCH] Fix stream playing --- inc/PlayTracks.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/inc/PlayTracks.php b/inc/PlayTracks.php index a2e77dc..a3d2588 100644 --- a/inc/PlayTracks.php +++ b/inc/PlayTracks.php @@ -10,7 +10,7 @@ } } else if ( ( isset($a) || (isset($play) && $play > 0) ) && isset($l) ) { - // Play all of the tracks for this alum + // Play all of the tracks for this album if ( isset($a) ) $qry = new PgQuery( "SELECT path_name, hash_key FROM tracks WHERE album = ? AND artist = ? ORDER BY setpart, tracknum;", $l, $a ); else @@ -24,15 +24,16 @@ else if ( ( isset($_POST['url']) && $_POST['act'] == 'Play URL' ) || ( isset($_GET['url']) && $_GET['act'] == 'Play URL' ) ) { $url = ( isset($_POST['url']) ? $_POST['url'] : $_GET['url'] ); - if ( $c->daemon_type == 'vlc' ) { - PlayTrack( $url, md5($url) ); + PlayTrack( $url, md5($url) ); - // Attempt to update the database with the stream details - $sql = "SELECT 1 FROM streams WHERE stream_url = ?"; + // Attempt to update the database with the stream details + $sql = "SELECT 1 FROM streams WHERE stream_url = ?"; + $qry = new PgQuery( $sql, $url ); + if ( $qry->rows == 0 ) { + $sql = "INSERT INTO streams ( stream_url ) VALUES( ? )"; $qry = new PgQuery( $sql, $url ); - if ( $qry->rows == 0 ) { - $sql = "INSERT INTO streams ( stream_url ) VALUES( ? )"; - $qry = new PgQuery( $sql, $url ); - } } } + else if ( isset($_GET['i']) && isset($_GET['d']) ) { + daemon_move( intval($_GET['i']), (substr($_GET['d'],0,1) == 'd' ? 1 : -1) ); + } -- 2.11.4.GIT