From 13f10212ad31cd78f4796cfd8824dcc698b205e7 Mon Sep 17 00:00:00 2001 From: girst Date: Sat, 8 Jan 2022 23:54:59 +0100 Subject: [PATCH] only show 'SOON' badge if video hasn't premiered yet note: during the livestream phase, the final video length time will already be shown. --- app/youtube/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/youtube/__init__.py b/app/youtube/__init__.py index 56f5a09..b90f949 100644 --- a/app/youtube/__init__.py +++ b/app/youtube/__init__.py @@ -53,7 +53,9 @@ def feed(): 'title': title, 'length': length, 'livestream': livestream, - 'premiere': premiere, + 'premiere': premiere and (# only if it hasn't yet premiered: + datetime.strptime(published+'+0000', "%Y-%m-%d %H:%M:%S%z")>datetime.now(tz=timezone.utc) + ), 'published': published, 'playlist': playlist, 'pinned': display == 'pinned', -- 2.39.3