From cdca6bb55f377ca12f9b4f046c7369cfb279516b Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Wed, 6 Oct 2021 19:23:32 +0200 Subject: [PATCH] Fix Repaly Rai Play --- channels/raiplay.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/channels/raiplay.py b/channels/raiplay.py index 1cfff90d..0fd2098d 100644 --- a/channels/raiplay.py +++ b/channels/raiplay.py @@ -215,14 +215,15 @@ def replay(item): items = requests.get(item.channel_url).json().get('events', {}) now = datetime.datetime.now() h = int('{}{:02d}'.format(now.hour, now.minute)) - + today = now.strftime('%d-%m-%Y') with futures.ThreadPoolExecutor() as executor: - itlist = [executor.submit(itInfo, it) for it in items if it['has_video'] and int(it['hour'].replace(':','')) <= h] + itlist = [executor.submit(itInfo, it) for it in items if it['has_video'] and (int(it['hour'].replace(':','')) <= h or item.date != today)] for res in futures.as_completed(itlist): if res.result(): itemlist.append(res.result()) if not itemlist: return [Item(title='Non ci sono Replay per questo Canale')] + itemlist.sort(key=lambda it: it.title) return itemlist def play(item):