diff --git a/website/compare.html b/website/compare.html
index 1a940f9..ff5d3bf 100644
--- a/website/compare.html
+++ b/website/compare.html
@@ -22,16 +22,18 @@
table tr td:first-child {
text-align: left;
- padding:20px;
+ padding:10px;
+ width:33%;
}
table tr td {
text-align: center;
- padding:20px;
+ padding:10px;
}
table tr td:last-child {
text-align: right;
- padding:20px;
+ padding:10px;
+ width:33%;
}
@@ -41,8 +43,10 @@
KEY_NAME_SELF |
+
KEY_MATCH%
+
|
KEY_NAME_OTHER |
@@ -50,12 +54,21 @@
|
-
+ |
The size of the circle shows matching music taste.
The fuzziness of its border indicates differences in quantity.
|
|
+
+ |
+
+ Common Favorite
+ KEY_BESTARTIST_LINK
+
+ |
+ |
+
diff --git a/website/compare.py b/website/compare.py
index fbeda6f..338ddd2 100644
--- a/website/compare.py
+++ b/website/compare.py
@@ -1,6 +1,9 @@
import urllib
import database
import json
+from htmlgenerators import artistLink
+from utilities import getArtistImage
+
def instructions(keys):
@@ -27,9 +30,7 @@ def instructions(keys):
artists[a]["other"] -= common
artists[a]["common"] = common
- best = sorted((a for a in artists),key=lambda x: artists[x.lower()]["common"],reverse=True)
-
-
+ best = sorted((artists[a]["name"] for a in artists),key=lambda x: artists[x.lower()]["common"],reverse=True)
result = {
"unique_self":sum(artists[a]["self"] for a in artists if artists[a]["common"] == 0),
@@ -67,7 +68,8 @@ def instructions(keys):
pixel_fullmatch = fullmatch * 2.5
pixel_partialmatch = (fullmatch+partialmatch) * 2.5
- matchcolor = format(int(min(1,match/50)*255),"x") * 2 + format(int(max(0,match/50-1)*255),"x")
+ matchcolor = format(int(min(1,match/50)*255),"02x") * 2 + format(int(max(0,match/50-1)*255),"02x")
+
return {
"KEY_CIRCLE_CSS":",".join(css),
@@ -77,4 +79,6 @@ def instructions(keys):
"KEY_PARTIALMATCH":str(int(pixel_partialmatch)),
"KEY_NAME_SELF":owninfo["name"],
"KEY_NAME_OTHER":strangerinfo["name"],
+ "KEY_BESTARTIST_LINK":artistLink(best[0]),
+ "KEY_BESTARTIST_IMAGE":getArtistImage(best[0])
},[]