From 311ac991126f68b12a6a29747091544de4acf6a1 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Mon, 10 Mar 2008 05:24:59 +0000 Subject: minor fixes to the playlist, fixed up the democratic playlist kinda, still does not work completely --- lib/class/api.class.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/class/api.class.php') diff --git a/lib/class/api.class.php b/lib/class/api.class.php index 2d55aad5..50ca9609 100644 --- a/lib/class/api.class.php +++ b/lib/class/api.class.php @@ -98,7 +98,18 @@ class Api { $db_results = Dba::query($sql); $row = Dba::fetch_assoc($db_results); - return array('auth'=>$token,'api'=>self::$version,'update'=>date("r",$row['update']),'add'=>date("r",$row['add'])); + // Now we need to quickly get the totals of songs + $sql = "SELECT COUNT(`id`) AS `song`,COUNT(DISTINCT(`album`)) AS `album`,COUNT(DISTINCT(`artist`)) AS `artist` FROM `song`"; + $db_results = Dba::query($sql); + $counts = Dba::fetch_assoc($db_results); + + return array('auth'=>$token, + 'api'=>self::$version, + 'update'=>date("r",$row['update']), + 'add'=>date("r",$row['add']), + 'songs'=>$counts['song'], + 'albums'=>$counts['album'], + 'artists'=>$counts['artist']); } // match } // end while -- cgit