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

Commit 86136b1a authored by Mike Sheldon's avatar Mike Sheldon

Support users with very small number of loved tracks

parent bc0ae8c6
......@@ -392,9 +392,9 @@ class User {
$loved = $this->getLovedTracks(50);
$artists = array();
for($i = 0; $i < $limit; $i++) {
for($i = 0; $i < min($limit, count($loved) - 1); $i++) {
if($random) {
$n = rand(0, count($loved));
$n = rand(0, count($loved) - 1);
} else {
$n = $i;
}
......
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