diff --git a/static/functions/artist_cloud.js b/static/functions/artist_cloud.js
index dbd0590a..d414367a 100644
--- a/static/functions/artist_cloud.js
+++ b/static/functions/artist_cloud.js
@@ -1,5 +1,6 @@
(function($) {
+var LIMIT = 10;
var artistId, artistName;
var artistTags;
$(document).ready(function() {
@@ -17,11 +18,17 @@ function initArtistCloud() {
function loadArtists() {
- $.getJSON('ajax.php?action=similar_artists&id='+artistId, function(data) {
- var items = [];
-
- $.each(data, function(key, val) {
- addArtist(val['id'], val['name'], val['score']);
+ $.getJSON('ajax.php?action=similar_artists&id='+artistId+'&limit='+LIMIT, function(data) {
+ var first = true;
+ var ratio;
+ $.each(data, function(key, val) {
+ if(first) {
+ ratio = val['score'] / 300;
+ first = false;
+ }
+ var score = val['score'] / ratio;
+ score = score <= 150 ? 150 : score;
+ addArtist(val['id'], val['name'], score);
});
createCloud();
@@ -30,8 +37,7 @@ function loadArtists() {
}
function addArtist(id, name, score) {
- var item = $('
' + name + '');
-// var item = $('
' + name + '');
+ var item = $('
' + name + '');
$(item).click(function(e) {
@@ -44,10 +50,8 @@ function addArtist(id, name, score) {
}
function addArtistMain(name) {
- var item = $('
' + name + '');
-
-// var item = $('
' + name + '');
-
+ var item = $('
' + name + '');
+
$("#currentArtist").attr('href', 'artist.php?id=' + artistId);
$("#currentArtist").text(artistName);