From 36bce348c34fe435a09cb20b52bd9a50c80a24a6 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Wed, 3 Feb 2021 09:59:24 +0100 Subject: [PATCH] get correct playlist when day_start is 00:00:00 --- ffplayout/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ffplayout/utils.py b/ffplayout/utils.py index ee44f23e..5e9bdd9b 100644 --- a/ffplayout/utils.py +++ b/ffplayout/utils.py @@ -648,9 +648,12 @@ def get_date(seek_day): """ d = date.today() if seek_day and get_time('full_sec') < _playlist.start: - yesterday = d - timedelta(1) - return yesterday.strftime('%Y-%m-%d') + return (d - timedelta(1)).strftime('%Y-%m-%d') else: + if _playlist.start == 0 and \ + math.isclose(get_time('full_sec'), 86400.0, abs_tol=4): + return (d + timedelta(1)).strftime('%Y-%m-%d') + return d.strftime('%Y-%m-%d')