fix unknown videos at startup

This commit is contained in:
simon 2023-01-12 20:46:41 +07:00
parent 092c467a2e
commit f665a1c7f5
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -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'"},
}