From 39d4c8bb9f958234dccb19ee963691feb515da26 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 3 Sep 2023 17:16:19 -0700 Subject: [PATCH] Fix bug ignoring all candidates regardless of is_shorts. In my hasty fix for the previous bug, I forgot part of the reason I had done the manual sql update. We need to set the is_shorts column. Also in my hasty fix I dropped the if entirely which auto ignored all shorts candidates instead of the ones confirmed by API. --- frontends/ycdl_flask/backend/common.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontends/ycdl_flask/backend/common.py b/frontends/ycdl_flask/backend/common.py index e85da64..81ce48e 100644 --- a/frontends/ycdl_flask/backend/common.py +++ b/frontends/ycdl_flask/backend/common.py @@ -151,7 +151,13 @@ def ignore_shorts_thread(rate): is_shorts = ycdl.ytapi.video_is_shorts(video.id) except Exception as exc: log.warning(traceback.format_exc()) - video.mark_state('ignored') + continue + video.is_shorts = is_shorts + pairs = {'id': video.id, 'is_shorts': int(is_shorts)} + if is_shorts: + pairs['state'] = 'ignored' + video.state = 'ignored' + ycdldb.update(table=ycdl.objects.Video, pairs=pairs, where_key='id') time.sleep(rate) def start_refresher_thread(rate):