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

Commit eaf434d9 authored by Mike Sheldon's avatar Mike Sheldon

Revert "Make similar artists radio less biased towards the original artist"

This reverts commit 9b795f06.
parent 9b795f06
......@@ -76,14 +76,10 @@ function make_playlist($session, $old_format=false) {
} elseif(ereg('l(ast|ibre)fm://artist/(.*)/similarartists', $url, $regs)) {
$artist = new Artist($regs[2]);
$similarArtists = $artist->getSimilar(20);
$similarArtists[]['name'] = $artist->name;
$artistsClause;
for($i = 0; $i < 5; $i++) {
$artistsClause = 'lower(artist_name) = ' . $adodb->qstr(mb_strtolower($artist->name, 'UTF-8'));
for($i = 0; $i < 4; $i++) {
$r = rand(0, count($similarArtists) - 1);
if($i > 0) {
$artistsClause .= ' OR ';
}
$artistsClause .= 'lower(artist_name) = ' . $adodb->qstr(mb_strtolower($similarArtists[$r]['artist'], 'UTF-8'));
$artistsClause .= ' OR lower(artist_name) = ' . $adodb->qstr(mb_strtolower($similarArtists[$r]['artist'], 'UTF-8'));
}
$res = $adodb->Execute('SELECT name, artist_name, album_name, duration, streamurl FROM Track WHERE streamable=1 AND ' . $artistsClause);
} elseif(ereg('l(ast|ibre)fm://artist/(.*)', $url, $regs)) {
......
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