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

Commit 8cc59057 authored by Jonas Haraldsson's avatar Jonas Haraldsson

Re-enable recommdended artist cloud

Put a limit of 1000 in the $otherArtists sql query in $artist->getSimilar,
which should make it quick enough.
parent 7ba2b278
......@@ -368,7 +368,7 @@ class Artist {
// Narrow down similar artists to ones that at least share the most common tag and get hold of their other tags
$otherArtists = $adodb->CacheGetAll(86400, 'SELECT artist, lower(tag) as ltag, count(tag) as num FROM Tags INNER JOIN Artist ON Artist.name = Tags.artist WHERE Artist.streamable = 1 AND artist in '
. '(SELECT distinct(artist) FROM Tags WHERE lower(tag) = ' . $adodb->qstr($tmpTags[0]['ltag']) . ') '
. 'GROUP BY artist, ltag ORDER BY num DESC');
. 'GROUP BY artist, ltag ORDER BY num DESC LIMIT 1000');
$totalTags = array();
......@@ -51,8 +51,8 @@ if (isset($user->name)) {
$smarty->assign('nowplaying', $aUserNowPlaying);
} catch (Exception $e) {}
if ($user->hasLoved()) {
//$recommendedArtists = $user->getRecommended(10);
//$smarty->assign('recommendedArtists', $recommendedArtists);
$recommendedArtists = $user->getRecommended(10);
$smarty->assign('recommendedArtists', $recommendedArtists);
$lovedArtists = TagCloud::generateTagCloud('loved', 'artist', 10, 'userid', $user->uniqueid);
$smarty->assign('lovedArtists', $lovedArtists);
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