From 806448624de245b3aea17258bb7c64c5068438db Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 24 Feb 2022 21:25:12 +0700 Subject: [PATCH] return if no in progress videos --- tubearchivist/home/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tubearchivist/home/views.py b/tubearchivist/home/views.py index a196f6f..2366f03 100644 --- a/tubearchivist/home/views.py +++ b/tubearchivist/home/views.py @@ -172,6 +172,9 @@ class ArchivistResultsView(ArchivistViewConfig): def match_progress(self): """add video progress to result context""" results = RedisArchivist().list_items(f"{self.user_id}:progress:") + if not results: + return + progress = {i["youtube_id"]: i["position"] for i in results} for hit in self.context["results"]: video = hit["source"]