From fbce600c4edd2b530e6673b89513b1a26b068b64 Mon Sep 17 00:00:00 2001 From: Krateng Date: Fri, 10 Jan 2020 04:06:34 +0100 Subject: [PATCH] Various --- maloja/__init__.py | 2 +- maloja/database.py | 4 +- maloja/static/js/search.js | 2 +- maloja/static/less/maloja.less | 23 +++++++++ maloja/web/summary.pyhp | 85 ++++++++++++++++++++++++++++++++++ 5 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 maloja/web/summary.pyhp diff --git a/maloja/__init__.py b/maloja/__init__.py index 3f393c1..c794de0 100644 --- a/maloja/__init__.py +++ b/maloja/__init__.py @@ -7,7 +7,7 @@ author = { "email":"maloja@krateng.dev", "github": "krateng" } -version = 2,2,0 +version = 2,2,1 versionstr = ".".join(str(n) for n in version) diff --git a/maloja/database.py b/maloja/database.py index 6d5f713..974389a 100644 --- a/maloja/database.py +++ b/maloja/database.py @@ -208,11 +208,13 @@ def getTrackID(artists,title): TRACKS_NORMALIZED.append(obj_normalized) return i +import unicodedata # function to turn the name into a representation that can be easily compared, ignoring minor differences remove_symbols = ["'","`","’"] def normalize_name(name): - return "".join(char for char in name.lower() if char not in remove_symbols) + return "".join(char for char in unicodedata.normalize('NFD',name.lower()) + if char not in remove_symbols and unicodedata.category(char) != 'Mn') diff --git a/maloja/static/js/search.js b/maloja/static/js/search.js index eb96011..4aeef8f 100644 --- a/maloja/static/js/search.js +++ b/maloja/static/js/search.js @@ -16,7 +16,7 @@ function search(searchfield) { function html_to_fragment(html) { var template = document.createElement("template"); - template.innerHTML = resulthtml; + template.innerHTML = html; return template.content; } diff --git a/maloja/static/less/maloja.less b/maloja/static/less/maloja.less index 9fdb66d..7dc7ffe 100644 --- a/maloja/static/less/maloja.less +++ b/maloja/static/less/maloja.less @@ -706,6 +706,29 @@ table.tiles_5x5 td { } +.summary_rank { + background-size:cover; + background-position:center; + display: inline-block; +} + +.summary_rank_1 { + width:300px; + height:300px; + border: 6px solid gold; +} +.summary_rank_2 { + width:250px; + height:250px; + border: 4px solid silver; +} +.summary_rank_3 { + width:240px; + height:240px; + border: 3px solid #cd7f32; +} + + /* diff --git a/maloja/web/summary.pyhp b/maloja/web/summary.pyhp new file mode 100644 index 0000000..e195336 --- /dev/null +++ b/maloja/web/summary.pyhp @@ -0,0 +1,85 @@ + + + + + + Maloja - Summary + + + + + + + + + + + + +
+
+
+

Summary


+ + + +

+ + +
+ + + + + + + + + + + + + + + + + +
+ +

Artists

+
+ +

Tracks

+
+ + + entry = type[r] + isartist = type is artists + entity = entry["artist"] if isartist else entry["track"] + image = utilities.getArtistImage(entity,fast=True) if isartist else utilities.getTrackImage(entity['artists'],entity['title'],fast=True) + rank = entry["rank"] + + + + +
+ +
+ + +
+
+ + + + + +