diff --git a/README.md b/README.md index 76c0890..a7c05f0 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/database.py b/database.py index 83ee0a6..4adb4bf 100644 --- a/database.py +++ b/database.py @@ -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(): diff --git a/server.py b/server.py index b8ca71c..649a110 100755 --- a/server.py +++ b/server.py @@ -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/") diff --git a/website/maloja.css b/website/maloja.css index 3edab07..850c863 100644 --- a/website/maloja.css +++ b/website/maloja.css @@ -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%; diff --git a/website/start.html b/website/start.html index 99d356b..b79d76b 100644 --- a/website/start.html +++ b/website/start.html @@ -16,7 +16,13 @@

Top Artists

- +
KEY_POSITION_ARTIST KEY_ARTISTLINK + + + + +
KEY_POSITION_ARTIST KEY_ARTISTLINK
+
@@ -60,7 +66,13 @@

Top Tracks

- +
KEY_POSITION_TRACK KEY_TRACKLINK + + + + +
KEY_POSITION_TRACK KEY_TRACKLINK
+