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

Removed PYHP data

This commit is contained in:
Krateng 2020-08-27 16:08:52 +02:00
parent fb04dd507c
commit fddbfb6a41
11 changed files with 0 additions and 475 deletions

View File

@ -1,27 +0,0 @@
<div class="footer">
<div>
<span>Get your own Maloja scrobble server on <a target="_blank" rel="noopener noreferrer" href="https://github.com/krateng/maloja">GitHub</a></span>
</div>
<div>
<a href="/"><span style="font-weight:bold;">Maloja</span></a>
</div>
<div>
<span><input id="searchinput" placeholder="Search for an artist or track..." oninput="search(this)" onblur="clearresults()" /></span>
</div>
<span id="resultwrap" class="hide">
<div class="searchresults">
<span>Artists</span>
<table class="searchresults_artists" id="searchresults_artists">
</table>
<br/><br/>
<span>Tracks</span>
<table class="searchresults_tracks" id="searchresults_tracks">
</table>
</div>
</span>
</div>
<a href="/admin"><div title="Server Administration" id="settingsicon">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M17 12.645v-2.289c-1.17-.417-1.907-.533-2.28-1.431-.373-.9.07-1.512.6-2.625l-1.618-1.619c-1.105.525-1.723.974-2.626.6-.9-.374-1.017-1.117-1.431-2.281h-2.29c-.412 1.158-.53 1.907-1.431 2.28h-.001c-.9.374-1.51-.07-2.625-.6l-1.617 1.619c.527 1.11.973 1.724.6 2.625-.375.901-1.123 1.019-2.281 1.431v2.289c1.155.412 1.907.531 2.28 1.431.376.908-.081 1.534-.6 2.625l1.618 1.619c1.107-.525 1.724-.974 2.625-.6h.001c.9.373 1.018 1.118 1.431 2.28h2.289c.412-1.158.53-1.905 1.437-2.282h.001c.894-.372 1.501.071 2.619.602l1.618-1.619c-.525-1.107-.974-1.723-.601-2.625.374-.899 1.126-1.019 2.282-1.43zm-8.5 1.689c-1.564 0-2.833-1.269-2.833-2.834s1.269-2.834 2.833-2.834 2.833 1.269 2.833 2.834-1.269 2.834-2.833 2.834zm15.5 4.205v-1.077c-.55-.196-.897-.251-1.073-.673-.176-.424.033-.711.282-1.236l-.762-.762c-.52.248-.811.458-1.235.283-.424-.175-.479-.525-.674-1.073h-1.076c-.194.545-.25.897-.674 1.073-.424.176-.711-.033-1.235-.283l-.762.762c.248.523.458.812.282 1.236-.176.424-.528.479-1.073.673v1.077c.544.193.897.25 1.073.673.177.427-.038.722-.282 1.236l.762.762c.521-.248.812-.458 1.235-.283.424.175.479.526.674 1.073h1.076c.194-.545.25-.897.676-1.074h.001c.421-.175.706.034 1.232.284l.762-.762c-.247-.521-.458-.812-.282-1.235s.529-.481 1.073-.674zm-4 .794c-.736 0-1.333-.597-1.333-1.333s.597-1.333 1.333-1.333 1.333.597 1.333 1.333-.597 1.333-1.333 1.333z"/></svg>
</div></a>

View File

@ -1,11 +0,0 @@
<meta name="description" content='Maloja is a self-hosted music scrobble server.' />
<!--<link rel="stylesheet/less" href="/less/maloja.less" />
<link rel="stylesheet/less" href="/less/grisons.less" />
<link rel="stylesheet" href="/css/maloja.css" />
<link rel="stylesheet" href="/css/grisons.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/3.9.0/less.min.js" ></script> -->
<link rel="stylesheet" href="/style.css" />
<script src="/search.js"></script>
<script src="/neopolitan.js"></script>
<script src="/upload.js"></script>

View File

@ -1,76 +0,0 @@
<pyhp>
if amountkeys.get("max_") is not None: amountkeys["perpage"],amountkeys["page"] = amountkeys["max_"],0
firstindex = amountkeys["page"] * amountkeys["perpage"]
lastindex = firstindex + amountkeys["perpage"]
</pyhp>
<pyhp import="math" />
<pyhp save="db.get_charts_artists(**filterkeys,**limitkeys)" as="artists" />
<pyhp save="math.ceil(len(artists) / amountkeys['perpage'])" as="pages" />
<pyhp>
try:
artistslast = db.get_charts_artists(**filterkeys,timerange=limitkeys["timerange"].next(step=-1))
# create rank association
lastrank = {}
for al in artistslast:
lastrank[al["artist"]] = al["rank"]
for a in artists:
try:
a["delta"] = lastrank[a["artist"]] - a["rank"]
except:
a["delta"] = math.inf
except:
pass
</pyhp>
<!--
if artists != []:
maxbar = artists[0]["scrobbles"]
representative = artists[0]["artist"]
else:
representative = None
-->
<pyhp save="artists[0]['scrobbles'] if artists != [] else 0" as="maxbar" />
<table class='list'>
<pyhp save="True" as="first" />
<pyhp for="e" in="artists[firstindex:lastindex]">
<tr>
<!-- Rank -->
<td class="rank"><pyhp if="first or e['scrobbles'] < prev['scrobbles']">#<pyhp echo="e['rank']"/></pyhp></td>
<pyhp save="False" as="first" />
<!-- Rank change -->
<pyhp if="e.get('delta') is not None">
<pyhp if="e.get('delta') is math.inf">
<td class='rankup' title='New'>🆕</td>
</pyhp>
<pyhp if="e.get('delta') > 0 and e.get('delta') is not math.inf">
<td class='rankup' title="up from #{e['rank']+e['delta']}">↗</td>
</pyhp>
<pyhp if="e.get('delta') < 0">
<td class='rankdown' title="down from #{e['rank']+e['delta']}">↘</td>
</pyhp>
<pyhp if="e.get('delta') == 0">
<td class='ranksame' title="Unchanged">➡</td>
</pyhp>
</pyhp>
<!-- artist -->
<pyhp echo="htmlgenerators.entity_column(e['artist'],counting=e['counting'])" />
<!-- scrobbles -->
<td class="amount"><pyhp echo="htmlgenerators.scrobblesArtistLink(e['artist'],urihandler.internal_to_uri(limitkeys),amount=e['scrobbles'],associated=True)" /></td>
<td class="bar"><pyhp echo="htmlgenerators.scrobblesArtistLink(e['artist'],urihandler.internal_to_uri(limitkeys),percent=e['scrobbles']*100/maxbar,associated=True)" /></td>
</tr>
<pyhp save="e" as="prev" />
</pyhp>
</table>
<pyhp if="amountkeys.get('max_') is None">
<pyhp include="pagination.pyhp" />
</pyhp>

View File

@ -1,49 +0,0 @@
<pyhp>
num_levels = 3
</pyhp>
<pyhp import="math" />
<pyhp save="db.get_charts_artists(**filterkeys,**limitkeys)" as="artists" />
<pyhp save="iter(artists)" as="artists_iterator" />
<table class="tiles_top">
<tr>
<pyhp for="level" in="range(1,num_levels+1)">
<td><table class="tiles_{level}x{level} tiles_sub">
<pyhp for="row" in="range(level)">
<tr>
<pyhp for="column" in="range(level)">
<pyhp>
try:
entry = next(artists_iterator)
artist = entry['artist']
rank = entry['rank']
except:
artist = None
</pyhp>
<pyhp if="artist is None">
<td><span class='stats'></span> <span></span></td>
</pyhp>
<pyhp if="artist is not None">
<td onclick='window.location.href="{htmlgenerators.link_address(artist)}"'
style='cursor:pointer;background-image:url("{utilities.getArtistImage(artist,fast=True)}");'>
<span class='stats'>
#<pyhp echo="rank" />
</span>
<span>
<pyhp echo="htmlgenerators.html_link(artist)" />
</span>
</td>
</pyhp>
</pyhp>
</tr>
</pyhp>
</table></td>
</pyhp>
</tr>
</table>

View File

@ -1,70 +0,0 @@
<pyhp>
if amountkeys.get("max_") is not None: amountkeys["perpage"],amountkeys["page"] = amountkeys["max_"],0
firstindex = amountkeys["page"] * amountkeys["perpage"]
lastindex = firstindex + amountkeys["perpage"]
</pyhp>
<pyhp import="math" />
<pyhp save="db.get_charts_tracks(**filterkeys,**limitkeys)" as="tracks" />
<pyhp save="math.ceil(len(tracks) / amountkeys['perpage'])" as="pages" />
<pyhp>
try:
trackslast = db.get_charts_tracks(**kwargs_filter,timerange=kwargs_time["timerange"].next(step=-1))
# create rank association
lastrank = {}
for tl in trackslast:
lastrank[(*tl["track"]["artists"],tl["track"]["title"])] = tl["rank"]
for t in tracks:
try:
t["delta"] = lastrank[(*t["track"]["artists"],t["track"]["title"])] - t["rank"]
except:
t["delta"] = math.inf
except:
pass
</pyhp>
<pyhp save="tracks[0]['scrobbles'] if tracks != [] else 0" as="maxbar" />
<table class='list'>
<pyhp save="True" as="first" />
<pyhp for="e" in="tracks[firstindex:lastindex]">
<tr>
<!-- Rank -->
<td class="rank"><pyhp if="first or e['scrobbles'] < prev['scrobbles']">#<pyhp echo="e['rank']"/></pyhp></td>
<pyhp save="False" as="first" />
<!-- Rank change -->
<pyhp if="e.get('delta') is not None">
<pyhp if="e.get('delta') is math.inf">
<td class='rankup' title='New'>🆕</td>
</pyhp>
<pyhp if="e.get('delta') > 0 and e.get('delta') is not math.inf">
<td class='rankup' title="up from #{e['rank']+e['delta']}">↗</td>
</pyhp>
<pyhp if="e.get('delta') < 0">
<td class='rankdown' title="down from #{e['rank']+e['delta']}">↘</td>
</pyhp>
<pyhp if="e.get('delta') == 0">
<td class='ranksame' title="Unchanged">➡</td>
</pyhp>
</pyhp>
<!-- artist -->
<pyhp echo="htmlgenerators.entity_column(e['track'])" />
<!-- scrobbles -->
<td class="amount"><pyhp echo="htmlgenerators.scrobblesTrackLink(e['track'],urihandler.internal_to_uri(limitkeys),amount=e['scrobbles'])" /></td>
<td class="bar"><pyhp echo="htmlgenerators.scrobblesTrackLink(e['track'],urihandler.internal_to_uri(limitkeys),percent=e['scrobbles']*100/maxbar)" /></td>
</tr>
<pyhp save="e" as="prev" />
</pyhp>
</table>
<pyhp if="amountkeys.get('max_') is None">
<pyhp include="pagination.pyhp" />
</pyhp>

View File

@ -1,51 +0,0 @@
<pyhp>
num_levels = 3
</pyhp>
<pyhp import="math" />
<pyhp save="db.get_charts_tracks(**filterkeys,**limitkeys)" as="tracks" />
<pyhp save="iter(tracks)" as="tracks_iterator" />
<table class="tiles_top">
<tr>
<pyhp for="level" in="range(1,num_levels+1)">
<td><table class="tiles_{level}x{level} tiles_sub">
<pyhp for="row" in="range(level)">
<tr>
<pyhp for="column" in="range(level)">
<pyhp>
try:
entry = next(tracks_iterator)
track = entry['track']
artists = track['artists']
title = track['title']
rank = entry['rank']
except:
track = None
</pyhp>
<pyhp if="track is None">
<td><span class='stats'></span> <span></span></td>
</pyhp>
<pyhp if="track is not None">
<td onclick='window.location.href="{htmlgenerators.link_address(track)}"'
style='cursor:pointer;background-image:url("{utilities.getTrackImage(artists,title,fast=True)}");'>
<span class='stats'>
#<pyhp echo="rank" />
</span>
<span>
<pyhp echo="htmlgenerators.html_link(track)" />
</span>
</td>
</pyhp>
</pyhp>
</tr>
</pyhp>
</table></td>
</pyhp>
</tr>
</table>

View File

@ -1,8 +0,0 @@
<a href='/scrobbles?{uri_query(track)}&{compose_querystring(timekeys)}'>
<pyhp if="amount is not None">
<pyhp echo="amount" />
</pyhp>
<pyhp if="amount is None">
<div style='width:{percent}%;'></div>
</pyhp>
</a>

View File

@ -1,36 +0,0 @@
<pyhp save="{'perpage':amountkeys['perpage'],**filterkeys,**limitkeys,**delimitkeys}" as="unchanged" />
<pyhp save="amountkeys['page']" as="page" />
<pyhp save="urihandler.compose_querystring" as="compose" />
<pyhp save="urihandler.internal_to_uri" as="touri" />
<div class='paginate'>
<pyhp if="pages > 1">
<pyhp if="page > 1">
<a href='?{compose(touri(dict(**unchanged,page=0)))}'><span class='stat_selector'>1</span></a> |
</pyhp>
<pyhp if="page > 2"> ... | </pyhp>
<pyhp if="page > 0">
<a href='?{compose(touri(dict(**unchanged,page=page-1)))}'><span class='stat_selector'><pyhp echo="page" /></span></a> «
</pyhp>
<span style='opacity:0.5;' class='stat_selector'>
<pyhp echo="page+1" />
</span>
<pyhp if="page < pages - 1">
» <a href='?{compose(touri(dict(**unchanged,page=page+1)))}'><span class='stat_selector'><pyhp echo="page+2" /></span></a>
</pyhp>
<pyhp if="page < pages - 3"> | ... </pyhp>
<pyhp if="page < pages - 2">
| <a href='?{compose(touri(dict(**unchanged,page=pages-1)))}'><span class='stat_selector'><pyhp echo="pages" /></span></a>
</pyhp>
</pyhp>
</div>

View File

@ -1,31 +0,0 @@
<pyhp>
if amountkeys["max_"] is not None: amountkeys["perpage"],amountkeys["page"] = amountkeys["max_"],0
firstindex = amountkeys["page"] * amountkeys["perpage"]
lastindex = firstindex + amountkeys["perpage"]
</pyhp>
<pyhp import="math" />
<pyhp save="db.get_performance(**limitkeys,**delimitkeys,**filterkeys)" as="allranges" />
<pyhp save="math.ceil(len(allranges) / amountkeys['perpage'])" as="pages" />
<pyhp save="allranges[firstindex:lastindex]" as="displayranges" />
<pyhp>
minrank = 80
for t in displayranges:
if t["rank"] is not None and t["rank"]+20 > minrank: minrank = t["rank"]+20
</pyhp>
</pyhp>
<table class="list">
<pyhp for="t" in="displayranges">
<pyhp save="t['range']" as="thisrange" />
<tr>
<td><pyhp echo="thisrange.desc()" /></td>
<td class='rank'><pyhp echo="'#' + str(t['rank']) if t['rank'] is not None else 'n/a'" /></td>
<pyhp save="(minrank+1-t['rank'])*100/minrank if t['rank'] is not None else 0" as="prct" />
<td class='chart'><pyhp echo="htmlgenerators.rankLink(thisrange.urikeys(),percent=prct,**filterkeys,medal=t['rank'])" /></td>
</tr>
</pyhp>
</table>

View File

@ -1,31 +0,0 @@
<pyhp>
if amountkeys.get("max_") is not None: amountkeys["perpage"],amountkeys["page"] = amountkeys["max_"],0
firstindex = amountkeys["page"] * amountkeys["perpage"]
lastindex = firstindex + amountkeys["perpage"]
</pyhp>
<pyhp import="math" />
<pyhp save="db.get_pulse(**limitkeys,**delimitkeys,**filterkeys)" as="allranges" />
<pyhp save="math.ceil(len(allranges) / amountkeys['perpage'])" as="pages" />
<pyhp save="allranges[firstindex:lastindex]" as="displayranges" />
<pyhp save="max(max([t['scrobbles'] for t in displayranges]),1)" as="maxbar" />
<table class="list">
<pyhp for="t" in="displayranges">
<pyhp save="t['range']" as="thisrange" />
<tr>
<td><pyhp echo="thisrange.desc()" /></td>
<td class="amount"><pyhp echo="htmlgenerators.scrobblesLink(thisrange.urikeys(),amount=t['scrobbles'],**filterkeys)" /></td>
<td class="bar"><pyhp echo="htmlgenerators.scrobblesLink(thisrange.urikeys(),percent=t['scrobbles']*100/maxbar,**filterkeys)" /></td>
</tr>
</pyhp>
</table>
<pyhp if="amountkeys.get('max_') is None">
<pyhp include="pagination.pyhp" />
<!-- <pyhp echo="htmlmodules.module_paginate(page=amountkeys['page'],pages=pages,perpage=amountkeys['perpage'],**_urikeys)" />-->
</pyhp>

View File

@ -1,85 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Maloja - Summary</title>
<script src="/datechange.js" async></script>
<pyhp include="common/header.html" />
</head>
<body>
<table class="top_info">
<tr>
<td class="image">
<div style="background-image:url('/favicon.png')"></div>
</td>
<td class="text">
<h1>Summary</h1><br/>
<span>
<pyhp echo="limitkeys['timerange'].desc(prefix=False)" />
</span>
<br/><br/>
<pyhp echo="htmlmodules.module_filterselection(_urikeys)" />
</td>
</tr>
</table>
<pyhp save="db.get_charts_artists(**filterkeys,**limitkeys)" as="artists" />
<pyhp save="db.get_charts_tracks(**filterkeys,**limitkeys)" as="tracks" />
<table class="twopart"><tr>
<pyhp for="type" in="(artists,tracks)">
<td>
<pyhp if="type is artists">
<h2><a href='/charts_artists'>Artists</a></h2>
</pyhp>
<pyhp if="type is tracks">
<h2><a href='/charts_tracks'>Tracks</a></h2>
</pyhp>
<pyhp for="r" in="range(min(3,len(type)))">
<pyhp>
entry = type[r]
isartist = type is artists
entity = entry["artist"] if isartist else entry["track"]
image = utilities.getArtistImage(entity,fast=True) if isartist else utilities.getTrackImage(entity['artists'],entity['title'],fast=True)
rank = entry["rank"]
</pyhp>
<div class="summary_rank summary_rank_{r+1}" onclick='window.location.href="{htmlgenerators.link_address(entity)}"'
style='cursor:pointer;background-image:url("{image}");'>
</div>
<!--
<span class='stats'>
#<pyhp echo="rank" />
</span>
<span>
<pyhp echo="htmlgenerators.html_link(entity)" />
</span>
-->
</pyhp>
</td>
<pyhp if="type is artists">
<pyhp include="partial/charts_artists.pyhp" with="{'max_':15}" />
</pyhp>
<pyhp if="type is tracks">
<pyhp include="partial/charts_tracks.pyhp" with="{'max_':15}" />
</pyhp>
</pyhp>
</tr></table>
<pyhp include="common/footer.html" />
</body>
</html>