1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Fixed search

This commit is contained in:
Krateng 2019-12-10 20:49:43 +01:00
parent 01bf88f83d
commit 246f61ee14
6 changed files with 25 additions and 9 deletions

View File

@ -22,7 +22,6 @@ Also neat: You can use your **custom artist or track images**.
## Requirements ## Requirements
* Python 3.5 or higher * Python 3.5 or higher
* Several Pip packages (automatically downloaded)
* If you'd like to display images, you will need API keys for [Last.fm](https://www.last.fm/api/account/create) and [Fanart.tv](https://fanart.tv/get-an-api-key/). These are free of charge! * If you'd like to display images, you will need API keys for [Last.fm](https://www.last.fm/api/account/create) and [Fanart.tv](https://fanart.tv/get-an-api-key/). These are free of charge!
## How to install ## How to install
@ -55,6 +54,14 @@ Also neat: You can use your **custom artist or track images**.
5) If you'd like to implement anything on top of Maloja, visit `/api_explorer`. 5) If you'd like to implement anything on top of Maloja, visit `/api_explorer`.
6) To backup your data, run
maloja backup
or, to only backup essential data (no artwork etc)
maloja backup -l minimal
## How to scrobble ## How to scrobble
### Native API ### Native API

View File

@ -7,7 +7,7 @@ author = {
"email":"maloja@krateng.dev", "email":"maloja@krateng.dev",
"github": "krateng" "github": "krateng"
} }
version = 2,0,8 version = 2,0,12
versionstr = ".".join(str(n) for n in version) versionstr = ".".join(str(n) for n in version)

View File

@ -29,7 +29,7 @@ os.chdir(DATA_DIR)
def copy_initial_local_files(): def copy_initial_local_files():
folder = pkg_resources.resource_filename(__name__,"data_files") folder = pkg_resources.resource_filename(__name__,"data_files")
#shutil.copy(folder,DATA_DIR) #shutil.copy(folder,DATA_DIR)
dir_util.copy_tree(folder,DATA_DIR) dir_util.copy_tree(folder,DATA_DIR,update=False)
def setup(): def setup():

View File

@ -108,6 +108,8 @@ replacetitle 여자 대통령 Female President
# Mamamoo # Mamamoo
countas Hwasa Mamamoo countas Hwasa Mamamoo
countas Moonbyul Mamamoo
replaceartist Moon Byul Moonbyul
replaceartist Hwa Sa Hwasa replaceartist Hwa Sa Hwasa
replaceartist MAMAMOO Mamamoo replaceartist MAMAMOO Mamamoo
replacetitle Egotistic(너나 해) Egotistic replacetitle Egotistic(너나 해) Egotistic

Can't render this file because it has a wrong number of fields in line 5.

View File

@ -1,3 +1,5 @@
function search(searchfield) { function search(searchfield) {
txt = searchfield.value; txt = searchfield.value;
if (txt == "") { if (txt == "") {
@ -18,10 +20,15 @@ function html_to_fragment(html) {
return template.content; return template.content;
} }
var results_artists;
var results_tracks;
var searchresultwrap;
const results_artists = document.getElementById("searchresults_artists"); window.addEventListener("DOMContentLoaded",function(){
const results_tracks = document.getElementById("searchresults_tracks"); results_artists = document.getElementById("searchresults_artists");
const searchresultwrap = document.getElementById("resultwrap"); results_tracks = document.getElementById("searchresults_tracks");
searchresultwrap = document.getElementById("resultwrap");
});
var resulthtml = ` var resulthtml = `
<tr> <tr>
@ -57,7 +64,7 @@ function searchresult() {
image = artists[i]["image"]; image = artists[i]["image"];
var node = oneresult.cloneNode(true); var node = oneresult.cloneNode(true);
node.setAttribute("onclick","goto(" + link + ")"); node.setAttribute("onclick","goto('" + link + "')");
node.children[0].style.backgroundImage = "url('" + image + "')"; node.children[0].style.backgroundImage = "url('" + image + "')";
node.children[1].children[0].innerHTML = name; node.children[1].children[0].innerHTML = name;
@ -71,7 +78,7 @@ function searchresult() {
image = tracks[i]["image"]; image = tracks[i]["image"];
var node = oneresult.cloneNode(true); var node = oneresult.cloneNode(true);
node.setAttribute("onclick","goto(" + link + ")"); node.setAttribute("onclick","goto('" + link + "')");
node.children[0].style.backgroundImage = "url('" + image + "')"; node.children[0].style.backgroundImage = "url('" + image + "')";
node.children[1].children[0].innerHTML = artists; node.children[1].children[0].innerHTML = artists;
node.children[1].children[2].innerHTML = title; node.children[1].children[2].innerHTML = title;

View File

@ -6,6 +6,6 @@
<link rel="stylesheet" href="/css/grisons.css" /> <link rel="stylesheet" href="/css/grisons.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/3.9.0/less.min.js" ></script> --> <script src="//cdnjs.cloudflare.com/ajax/libs/less.js/3.9.0/less.min.js" ></script> -->
<link rel="stylesheet" href="/style.css" /> <link rel="stylesheet" href="/style.css" />
<script src="/search.js" async></script> <script src="/search.js"></script>
<script src="/neopolitan.js"></script> <script src="/neopolitan.js"></script>
<script src="/upload.js"></script> <script src="/upload.js"></script>