From 05816ac51df9add9933a94e886c3ff510fb4498f Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Mon, 10 Oct 2022 10:08:13 +1100 Subject: [PATCH] fix a bug where shift is calculated wrong we need to use the hour in PST, which we just hard-code as 8 hours. If we ever hit DST before the run, we'll go back and do it properly. --- thrimshim/thrimshim/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/thrimshim/thrimshim/main.py b/thrimshim/thrimshim/main.py index ccdc2f8..01efba1 100644 --- a/thrimshim/thrimshim/main.py +++ b/thrimshim/thrimshim/main.py @@ -179,7 +179,9 @@ def get_row(ident): if response['event_start'] is not None: start = response['event_start'] if response['thumbnail_template'] is None: - response['thumbnail_template'] = DEFAULT_TEMPLATES[int(start.hour / 6)] + pst_hour = (start.hour - 8) % 24 + shift = int(pst_hour / 6) + response['thumbnail_template'] = DEFAULT_TEMPLATES[shift] if response['thumbnail_time'] is None: if response['event_end'] is not None: # take full duration, and add half to start to get halfway