We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit fbe2bce9 authored by Mike Sheldon's avatar Mike Sheldon

Fix recommended radio station

parent 4f940c13
......@@ -429,10 +429,12 @@ class User {
}
}
$limit = min($limit, count($recommendedArtists) - 1);
if($random) {
$randomArtists = array();
$keys = array_keys($recommendedArtists);
for($i = 0; $i < $limit; $i++) {
$randomArtists[] = $recommendedArtists[rand(0, count($recommendedArtists) - 1)];
$randomArtists[] = $recommendedArtists[$keys[rand(0, count($recommendedArtists) - 1)]];
}
return $randomArtists;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment