summaryrefslogtreecommitdiffstats
path: root/lib/class/api.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-03-31 20:53:39 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-03-31 20:53:39 +0000
commitf2f017d2b882f37f5d43651a57fc795bd0e2e6e8 (patch)
tree0cabe9bec23ddae735747558376e877dd911a39a /lib/class/api.class.php
parent0b081cf87b0bdc8149515453fe5ca02142551550 (diff)
downloadampache-f2f017d2b882f37f5d43651a57fc795bd0e2e6e8.tar.gz
ampache-f2f017d2b882f37f5d43651a57fc795bd0e2e6e8.tar.bz2
ampache-f2f017d2b882f37f5d43651a57fc795bd0e2e6e8.zip
add video counts to api handshake
Diffstat (limited to 'lib/class/api.class.php')
-rw-r--r--lib/class/api.class.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/class/api.class.php b/lib/class/api.class.php
index 397d5f19..2ba94a95 100644
--- a/lib/class/api.class.php
+++ b/lib/class/api.class.php
@@ -164,17 +164,22 @@ class Api {
// We need to also get the 'last update' of the catalog information in an RFC 2822 Format
$sql = "SELECT MAX(`last_update`) AS `update`,MAX(`last_add`) AS `add`, MAX(`last_clean`) AS `clean` FROM `catalog`";
- $db_results = Dba::query($sql);
+ $db_results = Dba::read($sql);
$row = Dba::fetch_assoc($db_results);
// 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);
+ $db_results = Dba::read($sql);
$counts = Dba::fetch_assoc($db_results);
+ // Next the video counts
+ $sql = "SELECT COUNT(`id`) AS `video` FROM `video`";
+ $db_results = Dba::read($sql);
+ $vcounts = Dba::fetch_assoc($db_results);
+
$sql = "SELECT COUNT(`id`) AS `playlist` FROM `playlist`";
- $db_results = Dba::query($sql);
+ $db_results = Dba::read($sql);
$playlist = Dba::fetch_assoc($db_results);
return array('auth'=>$token,
@@ -185,7 +190,8 @@ class Api {
'songs'=>$counts['song'],
'albums'=>$counts['album'],
'artists'=>$counts['artist'],
- 'playlists'=>$playlist['playlist']);
+ 'playlists'=>$playlist['playlist'],
+ 'videos'=>$vcounts['video']);
} // match
} // end while