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

Fixed error when no scrobbles present

This commit is contained in:
Krateng 2019-08-17 16:40:23 +02:00
parent 3ae30a5226
commit 6644863ca1

View File

@ -442,8 +442,12 @@ def update_medals():
from database import MEDALS, MEDALS_TRACKS, STAMPS, get_charts_artists, get_charts_tracks from database import MEDALS, MEDALS_TRACKS, STAMPS, get_charts_artists, get_charts_tracks
firstyear = datetime.datetime.utcfromtimestamp(STAMPS[0]).year
currentyear = datetime.datetime.utcnow().year currentyear = datetime.datetime.utcnow().year
try:
firstyear = datetime.datetime.utcfromtimestamp(STAMPS[0]).year
except:
firstyear = currentyear
MEDALS.clear() MEDALS.clear()
for year in range(firstyear,currentyear): for year in range(firstyear,currentyear):