mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-05 10:49:37 +02:00
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.
This commit is contained in:
parent
591a0b17c3
commit
c952ca6fa3
4 changed files with 20 additions and 33 deletions
|
@ -27,7 +27,7 @@ if (!defined('AJAX_INCLUDE')) { exit; }
|
|||
|
||||
switch ($_REQUEST['action']) {
|
||||
case 'album':
|
||||
$album_id = Random::album();
|
||||
$album_id = Album::get_random();
|
||||
|
||||
// If we don't get anything stop
|
||||
if (!$album_id) { $results['rfc3514'] = '0x1'; break; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue