From 6644863ca12017e3c7859d12b43b95b61aaf1537 Mon Sep 17 00:00:00 2001 From: Krateng Date: Sat, 17 Aug 2019 16:40:23 +0200 Subject: [PATCH] Fixed error when no scrobbles present --- utilities.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utilities.py b/utilities.py index 5b242d6..a575c97 100644 --- a/utilities.py +++ b/utilities.py @@ -442,8 +442,12 @@ def update_medals(): 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 + try: + firstyear = datetime.datetime.utcfromtimestamp(STAMPS[0]).year + except: + firstyear = currentyear + MEDALS.clear() for year in range(firstyear,currentyear):