mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Added database call for basic information
This commit is contained in:
parent
47f13028c4
commit
90b510bc0a
15
database.py
15
database.py
@ -225,7 +225,22 @@ def get_scrobbles(**keys):
|
|||||||
# return r
|
# return r
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
# info for comparison
|
||||||
|
@dbserver.get("info")
|
||||||
|
def info_external(**keys):
|
||||||
|
result = info()
|
||||||
|
return result
|
||||||
|
|
||||||
|
def info():
|
||||||
|
totalscrobbles = get_scrobbles_num()
|
||||||
|
artists = {}
|
||||||
|
|
||||||
|
return {
|
||||||
|
"name":settings.get_settings("NAME"),
|
||||||
|
"artists":{
|
||||||
|
chartentry["artist"]:round(chartentry["scrobbles"] * 100 / totalscrobbles,3)
|
||||||
|
for chartentry in get_charts_artists() if chartentry["scrobbles"]/totalscrobbles >= 0.001}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,6 +36,8 @@ DEFAULT_STEP_PULSE = month
|
|||||||
SCROBBLES_GOLD = 250
|
SCROBBLES_GOLD = 250
|
||||||
SCROBBLES_PLATINUM = 500
|
SCROBBLES_PLATINUM = 500
|
||||||
SCROBBLES_DIAMOND = 1000
|
SCROBBLES_DIAMOND = 1000
|
||||||
|
# name for comparisons
|
||||||
|
NAME = "Generic Maloja User"
|
||||||
|
|
||||||
[Misc]
|
[Misc]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user