mirror of
https://github.com/krateng/maloja.git
synced 2025-07-09 03:04:07 -04:00
Various
This commit is contained in:
parent
a8733994a1
commit
02c6742479
@ -431,9 +431,32 @@ def get_charts_albums(dbconn=None,resolve_ids=True,**keys):
|
|||||||
@waitfordb
|
@waitfordb
|
||||||
def get_pulse(dbconn=None,**keys):
|
def get_pulse(dbconn=None,**keys):
|
||||||
|
|
||||||
|
# amountkeys for pulse and performance aren't really necessary
|
||||||
|
# since the amount of entries is completely determined by the time keys
|
||||||
|
# but lets just include it in case
|
||||||
|
reverse = keys.get('reverse',False)
|
||||||
|
if keys.get('perpage',math.inf) is not math.inf:
|
||||||
|
limit = (keys.get('page',0)+1) * keys.get('perpage',100)
|
||||||
|
behead = keys.get('page',0) * keys.get('perpage',100)
|
||||||
|
else:
|
||||||
|
limit = math.inf
|
||||||
|
behead = 0
|
||||||
|
|
||||||
rngs = ranges(**{k:keys[k] for k in keys if k in ["since","to","within","timerange","step","stepn","trail"]})
|
rngs = ranges(**{k:keys[k] for k in keys if k in ["since","to","within","timerange","step","stepn","trail"]})
|
||||||
|
if reverse: rngs = reversed(list(rngs))
|
||||||
results = []
|
results = []
|
||||||
for rng in rngs:
|
for rng in rngs:
|
||||||
|
|
||||||
|
# count down how many we need
|
||||||
|
if limit==0:
|
||||||
|
break
|
||||||
|
limit -= 1
|
||||||
|
|
||||||
|
# skip prev pages
|
||||||
|
if behead>0:
|
||||||
|
behead -= 1
|
||||||
|
continue
|
||||||
|
|
||||||
res = get_scrobbles_num(timerange=rng,**{k:keys[k] for k in keys if k != 'timerange'},dbconn=dbconn)
|
res = get_scrobbles_num(timerange=rng,**{k:keys[k] for k in keys if k != 'timerange'},dbconn=dbconn)
|
||||||
results.append({"range":rng,"scrobbles":res})
|
results.append({"range":rng,"scrobbles":res})
|
||||||
|
|
||||||
@ -442,12 +465,40 @@ def get_pulse(dbconn=None,**keys):
|
|||||||
@waitfordb
|
@waitfordb
|
||||||
def get_performance(dbconn=None,**keys):
|
def get_performance(dbconn=None,**keys):
|
||||||
|
|
||||||
|
# amountkeys for pulse and performance aren't really necessary
|
||||||
|
# since the amount of entries is completely determined by the time keys
|
||||||
|
# but lets just include it in case
|
||||||
|
reverse = keys.get('reverse',False)
|
||||||
|
if keys.get('perpage',math.inf) is not math.inf:
|
||||||
|
limit = (keys.get('page',0)+1) * keys.get('perpage',100)
|
||||||
|
behead = keys.get('page',0) * keys.get('perpage',100)
|
||||||
|
else:
|
||||||
|
limit = math.inf
|
||||||
|
behead = 0
|
||||||
|
|
||||||
separate = keys.get('separate')
|
separate = keys.get('separate')
|
||||||
|
|
||||||
rngs = ranges(**{k:keys[k] for k in keys if k in ["since","to","within","timerange","step","stepn","trail"]})
|
rngs = ranges(**{k:keys[k] for k in keys if k in ["since","to","within","timerange","step","stepn","trail"]})
|
||||||
|
if reverse: rngs = reversed(list(rngs))
|
||||||
results = []
|
results = []
|
||||||
|
|
||||||
for rng in rngs:
|
for rng in rngs:
|
||||||
|
|
||||||
|
# count down how many we need
|
||||||
|
if limit==0:
|
||||||
|
break
|
||||||
|
limit -= 1
|
||||||
|
|
||||||
|
# skip prev pages
|
||||||
|
if behead>0:
|
||||||
|
behead -= 1
|
||||||
|
continue
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if "track" in keys:
|
if "track" in keys:
|
||||||
track_id = sqldb.get_track_id(keys['track'],dbconn=dbconn)
|
track_id = sqldb.get_track_id(keys['track'],dbconn=dbconn)
|
||||||
#track = sqldb.get_track(track_id,dbconn=dbconn)
|
#track = sqldb.get_track(track_id,dbconn=dbconn)
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
body {
|
body {
|
||||||
padding:15px;
|
padding:15px;
|
||||||
padding-bottom:35px;
|
padding-bottom:60px;
|
||||||
/**
|
/**
|
||||||
padding-top:45px;
|
padding-top:45px;
|
||||||
padding-bottom:25px;
|
padding-bottom:25px;
|
||||||
@ -267,10 +267,7 @@ div#footer {
|
|||||||
}
|
}
|
||||||
#notch img:hover {
|
#notch img:hover {
|
||||||
/*transform: scale(1.1);*/
|
/*transform: scale(1.1);*/
|
||||||
animation-name: spin;
|
animation: spin 4s linear infinite;
|
||||||
animation-duration: 4000ms;
|
|
||||||
animation-iteration-count: infinite;
|
|
||||||
animation-timing-function: linear;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes spin {
|
@keyframes spin {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user