summaryrefslogtreecommitdiffstats
path: root/lib/class/random.class.php
diff options
context:
space:
mode:
authorPaul Arthur <paul.arthur@flowerysong.com>2013-07-22 16:35:27 -0400
committerPaul Arthur <paul.arthur@flowerysong.com>2013-07-22 16:54:47 -0400
commitc952ca6fa369d68d18b4ba55cdc9ad3f17ed7c13 (patch)
treeb4ecf99b98d037cc2843637c58149e78f1af72bf /lib/class/random.class.php
parent591a0b17c3eab399d7c33b83ef924ff07cbbe635 (diff)
downloadampache-c952ca6fa369d68d18b4ba55cdc9ad3f17ed7c13.tar.gz
ampache-c952ca6fa369d68d18b4ba55cdc9ad3f17ed7c13.tar.bz2
ampache-c952ca6fa369d68d18b4ba55cdc9ad3f17ed7c13.zip
Be smarter about getting random albums with art
Just ask the database for what we want instead of asking for more results, sifting through them, and hoping that we get enough qualifying results to fulfill the request. Also drop Random::album(), since it's duplicate code and it makes more sense for this to live in Album.
Diffstat (limited to 'lib/class/random.class.php')
-rw-r--r--lib/class/random.class.php15
1 files changed, 0 insertions, 15 deletions
diff --git a/lib/class/random.class.php b/lib/class/random.class.php
index a4756db9..7b525641 100644
--- a/lib/class/random.class.php
+++ b/lib/class/random.class.php
@@ -45,21 +45,6 @@ class Random implements media {
} // constructor
/**
- * album
- * This returns the ID of a random album, nothing special
- */
- public static function album() {
-
- $sql = "SELECT `id` FROM `album` ORDER BY RAND() LIMIT 1";
- $db_results = Dba::read($sql);
-
- $results = Dba::fetch_assoc($db_results);
-
- return $results['id'];
-
- } // album
-
- /**
* artist
* This returns the ID of a random artist, nothing special here for now
*/