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.
This commit is contained in:
voussoir 2023-09-03 17:16:19 -07:00
parent b46dc1feb1
commit 39d4c8bb9f

View file

@ -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):