Added debugging for weird issue

This commit is contained in:
krateng 2023-10-22 17:22:16 +02:00
parent cc536f026e
commit ccf75898e7

View File

@ -621,9 +621,16 @@ def album_info(dbconn=None,**keys):
#scrobbles = get_scrobbles_num(track=track,timerange=alltime())
c = [e for e in alltimecharts if e["album"] == album][0]
scrobbles = c["scrobbles"]
position = c["rank"]
try:
c = [e for e in alltimecharts if e["album"] == album][0]
scrobbles = c["scrobbles"]
position = c["rank"]
except IndexError as e:
log(f"Error while finding album chart position for {album}",module="debug_special")
log(f"{e}",module="debug_special")
scrobbles, position = 0,0
cert = None
threshold_gold, threshold_platinum, threshold_diamond = malojaconfig["SCROBBLES_GOLD_ALBUM","SCROBBLES_PLATINUM_ALBUM","SCROBBLES_DIAMOND_ALBUM"]
if scrobbles >= threshold_diamond: cert = "diamond"