From 8f479d7f8f1f6b7bcbfff071d6eba33d37de5555 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Wed, 21 May 2008 22:04:15 +1200 Subject: [PATCH] Fix current_queue() list when there are no entries. --- inc/daemonInterface.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inc/daemonInterface.php b/inc/daemonInterface.php index 8f9b759..447e2ba 100644 --- a/inc/daemonInterface.php +++ b/inc/daemonInterface.php @@ -77,12 +77,14 @@ function current_queue() { $queue_pos[$track] = $position++; } + $queue = array(); + if ( $in_list == "" ) return $queue; + /** * Select the track information from the database */ $sql = sprintf("SELECT *, EXTRACT( 'epoch' FROM duration ) AS dur_secs FROM tracks WHERE path_name IN ( %s );", $in_list ); $qry = new PgQuery( $sql ); - $queue = array(); if ( $qry->Exec("current_queue",__LINE__,__FILE__) && $qry->rows ) { while( $track = $qry->Fetch() ) { $position = $queue_pos[$track->path_name]; -- 2.11.4.GIT