diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-03-10 05:24:59 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-03-10 05:24:59 +0000 |
commit | 311ac991126f68b12a6a29747091544de4acf6a1 (patch) | |
tree | 3e52ca25f8ba905e635c996cf31eafaff599ddde /lib/class/api.class.php | |
parent | 01a5512c04512a0d08d8de05705d87d6c9fe46d3 (diff) | |
download | ampache-311ac991126f68b12a6a29747091544de4acf6a1.tar.gz ampache-311ac991126f68b12a6a29747091544de4acf6a1.tar.bz2 ampache-311ac991126f68b12a6a29747091544de4acf6a1.zip |
minor fixes to the playlist, fixed up the democratic playlist kinda, still does not work completely
Diffstat (limited to 'lib/class/api.class.php')
-rw-r--r-- | lib/class/api.class.php | 13 |
1 files changed, 12 insertions, 1 deletions
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 |