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

Added medals for tracks

This commit is contained in:
Krateng
2019-04-04 21:29:03 +02:00
parent 3a70b0df1a
commit 5c2d9640ac
4 changed files with 37 additions and 12 deletions

View File

@@ -34,6 +34,7 @@ SCROBBLESDICT = {} # timestamps to scrobble mapping
STAMPS = [] # sorted
#STAMPS_SET = set() # as set for easier check if exists
MEDALS = {} #literally only changes once per year, no need to calculate that on the fly
MEDALS_TRACKS = {}
cla = CleanerAgent()
coa = CollectorAgent()
@@ -492,7 +493,7 @@ def trackInfo(artists,title):
position = charts.index(c)
while position != 0 and c["scrobbles"] == charts[position-1]["scrobbles"]: position -= 1
return {"scrobbles":scrobbles,"position":position + 1}
return {"scrobbles":scrobbles,"position":position + 1,"medals":MEDALS_TRACKS.get((frozenset(artists),title))}