summaryrefslogtreecommitdiffstats
path: root/lib/album.lib.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-08-05 22:39:53 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-08-05 22:39:53 +0000
commit246c321617b18035725b3d42c6a313386687cedc (patch)
tree45262291e66caae786ed06873c2fe9e67089f8ae /lib/album.lib.php
parentad3d2363c4c20d6b5049c8db92d08786650bd2ae (diff)
downloadampache-246c321617b18035725b3d42c6a313386687cedc.tar.gz
ampache-246c321617b18035725b3d42c6a313386687cedc.tar.bz2
ampache-246c321617b18035725b3d42c6a313386687cedc.zip
fixed some typos, minor bugs, updated the sql, added playlist as a browse type
Diffstat (limited to 'lib/album.lib.php')
-rw-r--r--lib/album.lib.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/album.lib.php b/lib/album.lib.php
index 8812cb4c..e04d494c 100644
--- a/lib/album.lib.php
+++ b/lib/album.lib.php
@@ -90,6 +90,14 @@ function get_image_from_source($data) {
* this is used by the index to return some 'potential' albums to play
*/
function get_random_albums($count=6) {
+
+ // Make sure that we have anything to pick from
+ $sql = "SELECT `id` FROM `album` LIMIT 7";
+ $db_results = Dba::query($sql);
+
+ $rows = Dba::num_rows($db_results);
+ if ($rows < 7) { return false; }
+
// There's a slight chance with this logic that the number of albums
// returned will be less than the number requested if the id's for the
// albums have signifigant gaps, but the speed increase is probably