mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Can now scrobble from track page
This commit is contained in:
parent
899f1ea121
commit
6372d2d8f2
2
info.py
2
info.py
@ -5,6 +5,6 @@ author = {
|
|||||||
"email":"maloja@krateng.dev",
|
"email":"maloja@krateng.dev",
|
||||||
"github": "krateng"
|
"github": "krateng"
|
||||||
}
|
}
|
||||||
version = 1,5,12
|
version = 1,5,13
|
||||||
versionstr = ".".join(str(n) for n in version)
|
versionstr = ".".join(str(n) for n in version)
|
||||||
dev = os.path.exists("./.dev")
|
dev = os.path.exists("./.dev")
|
||||||
|
@ -155,13 +155,13 @@ def static_html(name):
|
|||||||
|
|
||||||
adminmode = request.cookies.get("adminmode") == "true" and database.checkAPIkey(request.cookies.get("apikey")) is not False
|
adminmode = request.cookies.get("adminmode") == "true" and database.checkAPIkey(request.cookies.get("apikey")) is not False
|
||||||
|
|
||||||
|
|
||||||
# if a pyhp file exists, use this
|
# if a pyhp file exists, use this
|
||||||
if (pyhp_file and pyhp_pref) or (pyhp_file and not html_file):
|
if (pyhp_file and pyhp_pref) or (pyhp_file and not html_file):
|
||||||
from doreah.pyhp import file
|
from doreah.pyhp import file
|
||||||
environ = {} #things we expose to the pyhp pages
|
environ = {} #things we expose to the pyhp pages
|
||||||
|
|
||||||
environ["adminmode"] = adminmode
|
environ["adminmode"] = adminmode
|
||||||
|
if adminmode: environ["apikey"] = request.cookies.get("apikey")
|
||||||
|
|
||||||
# maloja
|
# maloja
|
||||||
environ["db"] = database
|
environ["db"] = database
|
||||||
|
@ -31,7 +31,8 @@
|
|||||||
<span><pyhp echo="htmlgenerators.artistLinks(track['artists'])" /></span><br/>
|
<span><pyhp echo="htmlgenerators.artistLinks(track['artists'])" /></span><br/>
|
||||||
<h1><pyhp echo="track['title']" /></h1> <pyhp if="info['certification'] is not None"><img class="certrecord" src="/media/record_{info['certification']}.png" title="This track has reached {info['certification'].capitalize()} status" /></pyhp> <span class="rank"><a href="/charts_tracks?max=100"><pyhp echo="positionstring" /></a></span>
|
<h1><pyhp echo="track['title']" /></h1> <pyhp if="info['certification'] is not None"><img class="certrecord" src="/media/record_{info['certification']}.png" title="This track has reached {info['certification'].capitalize()} status" /></pyhp> <span class="rank"><a href="/charts_tracks?max=100"><pyhp echo="positionstring" /></a></span>
|
||||||
|
|
||||||
<p class="stats"><a href="/scrobbles?{encodedtrack}"><pyhp echo="info['scrobbles']" /> Scrobbles</a></p>
|
<p class="stats"><pyhp if="adminmode"><span onclick="neo.xhttprequest('/api/newscrobble?{encodedtrack}key={apikey}').then(response=>{window.location.reload()});" class="button">Scrobble now</span> </pyhp><a href="/scrobbles?{encodedtrack}"><pyhp echo="info['scrobbles']" /> Scrobbles</a></p>
|
||||||
|
|
||||||
|
|
||||||
<pyhp for="year" in="info['medals']['gold']"><a title="Best Artist in {year}" class="hidelink medal shiny gold" href='/charts_artists?max=50&in={str(year)}'><span><pyhp echo="year" /></span></a></pyhp>
|
<pyhp for="year" in="info['medals']['gold']"><a title="Best Artist in {year}" class="hidelink medal shiny gold" href='/charts_artists?max=50&in={str(year)}'><span><pyhp echo="year" /></span></a></pyhp>
|
||||||
<pyhp for="year" in="info['medals']['silver']"><a title="Second best Artist in {year}" class="hidelink medal shiny silver" href='/charts_artists?max=50&in={str(year)}'><span><pyhp echo="year" /></span></a></pyhp>
|
<pyhp for="year" in="info['medals']['silver']"><a title="Second best Artist in {year}" class="hidelink medal shiny silver" href='/charts_artists?max=50&in={str(year)}'><span><pyhp echo="year" /></span></a></pyhp>
|
||||||
|
Loading…
Reference in New Issue
Block a user