From f665a1c7f51d179c241634463fd57c7bbbff2f52 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 12 Jan 2023 20:46:41 +0700 Subject: [PATCH] fix unknown videos at startup --- tubearchivist/home/apps.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tubearchivist/home/apps.py b/tubearchivist/home/apps.py index 073afcc7..ed06725d 100644 --- a/tubearchivist/home/apps.py +++ b/tubearchivist/home/apps.py @@ -128,11 +128,23 @@ class StartupCheck: ReleaseVersion().is_updated() def es_set_vid_type(self): - """update path 0.3.0 to 0.3.1, set default vid_type to video""" + """ + update path 0.3.0 to 0.3.1, set default vid_type to video + fix unidentified vids in unstable + """ index_list = ["ta_video", "ta_download"] data = { "query": { - "bool": {"must_not": [{"exists": {"field": "vid_type"}}]} + "bool": { + "should": [ + { + "bool": { + "must_not": [{"exists": {"field": "vid_type"}}] + } + }, + {"term": {"vid_type": {"value": "unknown"}}}, + ] + } }, "script": {"source": "ctx._source['vid_type'] = 'videos'"}, }