From 6a3fd46219ff36e77ae2f5793c5042baacf556e9 Mon Sep 17 00:00:00 2001 From: krateng Date: Tue, 31 Oct 2023 19:26:41 +0100 Subject: [PATCH] Fix GH-264 --- dev/releases/3.2.yml | 8 +++++++- maloja/malojatime.py | 2 -- maloja/pkg_global/conf.py | 4 ++-- maloja/thirdparty/spotify.py | 4 +++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dev/releases/3.2.yml b/dev/releases/3.2.yml index bcd0d53..03880a2 100644 --- a/dev/releases/3.2.yml +++ b/dev/releases/3.2.yml @@ -21,4 +21,10 @@ minor_release_name: "Nicole" - "[Technical] Bumped Python and SQLAlchemy versions" - "[Distribution] Removed build of arm/v7 image" 3.2.1: - notes: [] \ No newline at end of file + notes: + - "[Feature] Added setting for custom week offset" + - "[Bugfix] Fixed album entity rows being marked as track entity rows" + - "[Bugfix] Fixed scrobbling of tracks when all artists have been removed by server parsing" + - "[Bugfix] Fixed Spotify import of multiple files" + - "[Bugfix] Fixed process control on FreeBSD" + - "[Bugfix] Fixed Spotify authentication thread blocking the process from terminating" \ No newline at end of file diff --git a/maloja/malojatime.py b/maloja/malojatime.py index 9561fac..1af046d 100644 --- a/maloja/malojatime.py +++ b/maloja/malojatime.py @@ -214,8 +214,6 @@ class MTRangeWeek(MTRangeSingular): # do this so we can construct the week with overflow (eg 2020/-3) thisisoyear_firstday = date.fromisocalendar(year,1,1) + timedelta(days=malojaconfig['WEEK_OFFSET']-1) self.firstday = thisisoyear_firstday + timedelta(days=7*(week-1)) - self.firstday = date(self.firstday.year,self.firstday.month,self.firstday.day) - # for compatibility with pre python3.8 (https://bugs.python.org/issue32417) self.lastday = self.firstday + timedelta(days=6) diff --git a/maloja/pkg_global/conf.py b/maloja/pkg_global/conf.py index 36a6566..2ff5026 100644 --- a/maloja/pkg_global/conf.py +++ b/maloja/pkg_global/conf.py @@ -190,7 +190,8 @@ malojaconfig = Configuration( "delimiters_formal":(tp.Set(tp.String()), "Formal Delimiters", [";","/","|","␝","␞","␟"], "Delimiters used to tag multiple artists when only one tag field is available"), "filters_remix":(tp.Set(tp.String()), "Remix Filters", ["Remix", "Remix Edit", "Short Mix", "Extended Mix", "Soundtrack Version"], "Filters used to recognize the remix artists in the title"), "parse_remix_artists":(tp.Boolean(), "Parse Remix Artists", False), - "week_offset":(tp.Integer(), "Week Begin Offset", 0, "Start of the week for the purpose of weekly statistics. 0 = Sunday, 6 = Saturday") + "week_offset":(tp.Integer(), "Week Begin Offset", 0, "Start of the week for the purpose of weekly statistics. 0 = Sunday, 6 = Saturday"), + "timezone":(tp.Integer(), "UTC Offset", 0) }, "Web Interface":{ "default_range_startpage":(tp.Choice({'alltime':'All Time','year':'Year','month':"Month",'week':'Week'}), "Default Range for Startpage Stats", "year"), @@ -204,7 +205,6 @@ malojaconfig = Configuration( "discourage_cpu_heavy_stats":(tp.Boolean(), "Discourage CPU-heavy stats", False, "Prevent visitors from mindlessly clicking on CPU-heavy options. Does not actually disable them for malicious actors!"), "use_local_images":(tp.Boolean(), "Use Local Images", True), #"local_image_rotate":(tp.Integer(), "Local Image Rotate", 3600), - "timezone":(tp.Integer(), "UTC Offset", 0), "time_format":(tp.String(), "Time Format", "%d. %b %Y %I:%M %p"), "theme":(tp.String(), "Theme", "maloja") } diff --git a/maloja/thirdparty/spotify.py b/maloja/thirdparty/spotify.py index 3a8e55f..9d9e4b9 100644 --- a/maloja/thirdparty/spotify.py +++ b/maloja/thirdparty/spotify.py @@ -47,6 +47,8 @@ class Spotify(MetadataInterface): expire = responsedata.get("expires_in",3600) self.settings["token"] = responsedata["access_token"] #log("Successfully authenticated with Spotify") - Timer(expire,self.authorize).start() + t = Timer(expire,self.authorize) + t.daemon = True + t.start() except Exception as e: log("Error while authenticating with Spotify: " + repr(e))