Adjusted structure to be closer to albula
@ -7,7 +7,7 @@ author = {
|
|||||||
"email":"maloja@krateng.dev",
|
"email":"maloja@krateng.dev",
|
||||||
"github": "krateng"
|
"github": "krateng"
|
||||||
}
|
}
|
||||||
version = 2,0,3
|
version = 2,0,4
|
||||||
versionstr = ".".join(str(n) for n in version)
|
versionstr = ".".join(str(n) for n in version)
|
||||||
|
|
||||||
|
|
||||||
@ -23,6 +23,7 @@ requires = [
|
|||||||
resources = [
|
resources = [
|
||||||
"web/*/*",
|
"web/*/*",
|
||||||
"web/*",
|
"web/*",
|
||||||
|
"static/*/*",
|
||||||
"data_files/*/*",
|
"data_files/*/*",
|
||||||
"data_files/.doreah"
|
"data_files/.doreah"
|
||||||
]
|
]
|
||||||
|
@ -45,8 +45,9 @@ MAIN_PORT = settings.get_settings("WEB_PORT")
|
|||||||
HOST = settings.get_settings("HOST")
|
HOST = settings.get_settings("HOST")
|
||||||
THREADS = 12
|
THREADS = 12
|
||||||
BaseRequest.MEMFILE_MAX = 15 * 1024 * 1024
|
BaseRequest.MEMFILE_MAX = 15 * 1024 * 1024
|
||||||
WEBFOLDER = pkg_resources.resource_filename(__name__,"web")
|
|
||||||
|
|
||||||
|
WEBFOLDER = pkg_resources.resource_filename(__name__,"web")
|
||||||
|
STATICFOLDER = pkg_resources.resource_filename(__name__,"static")
|
||||||
|
|
||||||
webserver = Bottle()
|
webserver = Bottle()
|
||||||
|
|
||||||
@ -56,8 +57,8 @@ def generate_css():
|
|||||||
import lesscpy
|
import lesscpy
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
less = ""
|
less = ""
|
||||||
for f in os.listdir(pthjoin(WEBFOLDER,"less")):
|
for f in os.listdir(pthjoin(STATICFOLDER,"less")):
|
||||||
with open(pthjoin(WEBFOLDER,"less",f),"r") as lessf:
|
with open(pthjoin(STATICFOLDER,"less",f),"r") as lessf:
|
||||||
less += lessf.read()
|
less += lessf.read()
|
||||||
|
|
||||||
css = lesscpy.compile(StringIO(less),minify=True)
|
css = lesscpy.compile(StringIO(less),minify=True)
|
||||||
@ -153,27 +154,30 @@ def static_image(pth):
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
@webserver.route("/css/style.css")
|
@webserver.route("/style.css")
|
||||||
def get_css():
|
def get_css():
|
||||||
response.content_type = 'text/css'
|
response.content_type = 'text/css'
|
||||||
return css
|
return css
|
||||||
|
|
||||||
#@webserver.route("/<name:re:.*\\.html>")
|
|
||||||
@webserver.route("/<name:re:.*\\.js>")
|
@webserver.route("/<name>.<ext>")
|
||||||
@webserver.route("/<name:re:.*\\.less>")
|
def static(name,ext):
|
||||||
@webserver.route("/<name:re:.*\\.png>")
|
assert ext in ["txt","ico","jpeg","jpg","png","less","js"]
|
||||||
@webserver.route("/<name:re:.*\\.jpeg>")
|
response = static_file(ext + "/" + name + "." + ext,root=STATICFOLDER)
|
||||||
@webserver.route("/<name:re:.*\\.ico>")
|
response.set_header("Cache-Control", "public, max-age=3600")
|
||||||
@webserver.route("/<name:re:.*\\.txt>")
|
return response
|
||||||
def static(name):
|
|
||||||
response = static_file(name,root=WEBFOLDER)
|
@webserver.route("/media/<name>.<ext>")
|
||||||
|
def static(name,ext):
|
||||||
|
assert ext in ["ico","jpeg","jpg","png"]
|
||||||
|
response = static_file(ext + "/" + name + "." + ext,root=STATICFOLDER)
|
||||||
response.set_header("Cache-Control", "public, max-age=3600")
|
response.set_header("Cache-Control", "public, max-age=3600")
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
@webserver.route("/<name>")
|
@webserver.route("/<name>")
|
||||||
def static_html(name):
|
def static_html(name):
|
||||||
linkheaders = ["</css/style.css>; rel=preload; as=style"]
|
linkheaders = ["</style.css>; rel=preload; as=style"]
|
||||||
keys = remove_identical(FormsDict.decode(request.query))
|
keys = remove_identical(FormsDict.decode(request.query))
|
||||||
|
|
||||||
pyhp_file = os.path.exists(pthjoin(WEBFOLDER,name + ".pyhp"))
|
pyhp_file = os.path.exists(pthjoin(WEBFOLDER,name + ".pyhp"))
|
||||||
|
Before Width: | Height: | Size: 866 B After Width: | Height: | Size: 866 B |
Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 244 B |
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 239 B |
Before Width: | Height: | Size: 245 B After Width: | Height: | Size: 245 B |
Before Width: | Height: | Size: 240 B After Width: | Height: | Size: 240 B |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
@ -5,7 +5,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>Maloja</title>
|
<title>Maloja</title>
|
||||||
<script src="javascript/cookies.js"></script>
|
<script src="/cookies.js"></script>
|
||||||
|
|
||||||
<pyhp include="common/header.html" />
|
<pyhp include="common/header.html" />
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>Maloja - KEY_ARTISTNAME</title>
|
<title>Maloja - KEY_ARTISTNAME</title>
|
||||||
<script src="javascript/cookies.js"></script>
|
<script src="/cookies.js"></script>
|
||||||
<script src="javascript/rangeselect.js"></script>
|
<script src="/rangeselect.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
<title>Maloja - <pyhp echo="artist" /></title>
|
<title>Maloja - <pyhp echo="artist" /></title>
|
||||||
|
|
||||||
<pyhp include="common/header.html" />
|
<pyhp include="common/header.html" />
|
||||||
<script src="javascript/rangeselect.js"></script>
|
<script src="/rangeselect.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>Maloja - Artist Charts</title>
|
<title>Maloja - Artist Charts</title>
|
||||||
<script src="javascript/datechange.js" async></script>
|
<script src="/datechange.js" async></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<link rel="stylesheet" href="/css/maloja.css" />
|
<link rel="stylesheet" href="/css/maloja.css" />
|
||||||
<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="/css/style.css" />
|
<link rel="stylesheet" href="/style.css" />
|
||||||
<script src="/javascript/search.js" async></script>
|
<script src="/search.js" async></script>
|
||||||
<script src="/javascript/neopolitan.js"></script>
|
<script src="/neopolitan.js"></script>
|
||||||
<script src="/javascript/upload.js"></script>
|
<script src="/upload.js"></script>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>Maloja - Issues</title>
|
<title>Maloja - Issues</title>
|
||||||
<script src="javascript/cookies.js"></script>
|
<script src="/cookies.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>Maloja</title>
|
<title>Maloja</title>
|
||||||
<script src="javascript/cookies.js"></script>
|
<script src="/cookies.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function keyDetect(event) {
|
function keyDetect(event) {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>Maloja - Proxyscrobble</title>
|
<title>Maloja - Proxyscrobble</title>
|
||||||
<script src="javascript/cookies.js"></script>
|
<script src="/cookies.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.addEventListener("load",function(){
|
window.addEventListener("load",function(){
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>Maloja - Setup</title>
|
<title>Maloja - Setup</title>
|
||||||
<script src="javascript/cookies.js"></script>
|
<script src="/cookies.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
<script>document.addEventListener('DOMContentLoaded',function() {
|
<script>document.addEventListener('DOMContentLoaded',function() {
|
||||||
KEY_JS_INIT_RANGES
|
KEY_JS_INIT_RANGES
|
||||||
})</script>
|
})</script>
|
||||||
<script src="javascript/cookies.js"></script>
|
<script src="/cookies.js"></script>
|
||||||
<script src="javascript/rangeselect.js"></script>
|
<script src="/rangeselect.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>Maloja - KEY_TRACKTITLE</title>
|
<title>Maloja - KEY_TRACKTITLE</title>
|
||||||
<script src="javascript/cookies.js" ></script>
|
<script src="/cookies.js" ></script>
|
||||||
<script src="javascript/rangeselect.js"></script>
|
<script src="/rangeselect.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<title>Maloja - <pyhp echo="track['title']" /></title>
|
<title>Maloja - <pyhp echo="track['title']" /></title>
|
||||||
|
|
||||||
<pyhp include="common/header.html" />
|
<pyhp include="common/header.html" />
|
||||||
<script src="javascript/rangeselect.js"></script>
|
<script src="/rangeselect.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function scrobble(encodedtrack,apikey) {
|
function scrobble(encodedtrack,apikey) {
|
||||||
neo.xhttprequest('/api/newscrobble?' + encodedtrack + "key=" + apikey).then(response=>{window.location.reload()});
|
neo.xhttprequest('/api/newscrobble?' + encodedtrack + "key=" + apikey).then(response=>{window.location.reload()});
|
||||||
|