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

Small fixes

This commit is contained in:
Krateng 2019-02-02 20:51:04 +01:00
parent 8da02a679f
commit b58190495f
5 changed files with 30 additions and 8 deletions

View File

@ -22,7 +22,9 @@ I like to name my projects after regions in Grisons, Switzerland. Don't waste yo
## Current status
Deep in development. I just uploaded Maloja here in case I die tomorrow. It can accept scrobbles and return a few webpages (/artist, /scrobbles, /topartists).
You can check [my own Maloja page](https://maloja.krateng.ch) to see what it currently looks like.
The software works fairly well and has a few web views, but there is only one scrobbler (a Chrome extension for Plex).
## How to install

View File

@ -143,8 +143,11 @@ def get_scrobbles():
r = db_query(artists=keys.getall("artist"),title=keys.get("title"),since=keys.get("since"),to=keys.get("to"),associated=(keys.get("associated")!=None))
r.reverse()
return {"list":r} ##json can't be a list apparently???
if keys.get("max") is not None:
return {"list":r[:int(keys.get("max"))]}
else:
return {"list":r} ##json can't be a list apparently???
@dbserver.route("/numscrobbles")
def get_scrobbles():

View File

@ -70,7 +70,7 @@ def shutdown():
def graceful_exit(sig=None,frame=None):
urllib.request.urlopen("http://localhost:" + str(DATABASE_PORT) + "/sync")
log("Server shutting down...")
sys.exit()
os._exit(42)
@webserver.route("/images/<pth:re:.*\\.jpeg>")

View File

@ -231,10 +231,10 @@ table.tiles_top td {
border:0px;
}
table.tiles_top:hover td div {
table.tiles_top:hover td td {
opacity:0.2;
}
table.tiles_top:hover td div:hover {
table.tiles_top:hover td td:hover {
opacity:1;
}
@ -264,6 +264,11 @@ table.tiles_top td span {
background-color:rgba(0,0,0,0.7);
}
table.tiles_1x1 td {
height:100%;
width:100%;
font-size:100%
}
table.tiles_2x2 td {
height:50%;
width:50%;

View File

@ -16,7 +16,13 @@
<h1><a href="/topartists">Top Artists</a></h1>
<table class="tiles_top">
<tr>
<td style="background-image:url('KEY_ARTISTIMAGE')"><span class="stats">KEY_POSITION_ARTIST</span> <span>KEY_ARTISTLINK</span></td>
<td>
<table class="tiles_1x1 tiles_sub">
<tr>
<td style="background-image:url('KEY_ARTISTIMAGE')"><span class="stats">KEY_POSITION_ARTIST</span> <span>KEY_ARTISTLINK</span></td>
</tr>
</table>
</td>
<td>
<table class="tiles_2x2 tiles_sub">
<tr>
@ -60,7 +66,13 @@
<h1><a href="/toptracks">Top Tracks</a></h1>
<table class="tiles_top">
<tr>
<td style="background-image:url('KEY_TRACKIMAGE')"><span class="stats">KEY_POSITION_TRACK</span> <span>KEY_TRACKLINK</span></td>
<td>
<table class="tiles_1x1 tiles_sub">
<tr>
<td style="background-image:url('KEY_TRACKIMAGE')"><span class="stats">KEY_POSITION_TRACK</span> <span>KEY_TRACKLINK</span></td>
</tr>
</table>
</td>
<td>
<table class="tiles_2x2 tiles_sub">
<tr>