Updated API to reflect changes in scrobble pagination

This commit is contained in:
krateng 2023-10-24 20:38:23 +02:00
parent f33df482fb
commit 7ac6473ce3
3 changed files with 11 additions and 9 deletions

View File

@ -205,9 +205,10 @@ def get_scrobbles_external(**keys):
result = database.get_scrobbles(**ckeys) result = database.get_scrobbles(**ckeys)
offset = (k_amount.get('page') * k_amount.get('perpage')) if k_amount.get('perpage') is not math.inf else 0 # this should now all be served by the inner function
result = result[offset:] #offset = (k_amount.get('page') * k_amount.get('perpage')) if k_amount.get('perpage') is not math.inf else 0
if k_amount.get('perpage') is not math.inf: result = result[:k_amount.get('perpage')] #result = result[offset:]
#if k_amount.get('perpage') is not math.inf: result = result[:k_amount.get('perpage')]
return { return {
"status":"ok", "status":"ok",

View File

@ -323,7 +323,7 @@ def get_scrobbles(dbconn=None,**keys):
(since,to) = keys.get('timerange').timestamps() (since,to) = keys.get('timerange').timestamps()
reverse = keys.get('reverse',True) # comaptibility with old calls reverse = keys.get('reverse',True) # comaptibility with old calls
if 'perpage' in keys: if keys.get('perpage',math.inf) is not math.inf:
limit = (keys.get('page',0)+1) * keys.get('perpage',100) limit = (keys.get('page',0)+1) * keys.get('perpage',100)
behead = keys.get('page',0) * keys.get('perpage',100) behead = keys.get('page',0) * keys.get('perpage',100)
else: else:

View File

@ -243,7 +243,7 @@ div#footer {
#notch { #notch {
--notch-size: 80px; --notch-size: 70px;
background-color: var(--base-color-dark); background-color: var(--base-color-dark);
width: var(--notch-size); width: var(--notch-size);
height: var(--notch-size); height: var(--notch-size);
@ -252,15 +252,16 @@ div#footer {
z-index: 1; z-index: 1;
border-radius: 50%; border-radius: 50%;
transform: translate(0%, -30%); transform: translate(0%, -40%);
} }
#notch img { #notch img {
--notch-img-size: 80px;
position: absolute; position: absolute;
top: calc((var(--notch-size) - 100px) / 2); top: calc((var(--notch-size) - var(--notch-img-size)) / 2);
left: calc((var(--notch-size) - 100px) / 2); left: calc((var(--notch-size) - var(--notch-img-size)) / 2);
width: 100px; width: var(--notch-img-size);
height: auto; height: auto;
} }