fix reindex task, skip inactive in _get_unrated_vids

This commit is contained in:
simon 2022-09-14 16:43:48 +07:00
parent 2b8ec1f8cf
commit dfacc3039a
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 5 additions and 8 deletions

View File

@ -72,14 +72,11 @@ class Reindex:
def _get_unrated_vids(self):
"""get max 200 videos without rating if ryd integration is enabled"""
data = {
"size": 200,
"query": {
"bool": {
"must_not": [{"exists": {"field": "stats.average_rating"}}]
}
},
}
must_not_list = [
{"exists": {"field": "stats.average_rating"}},
{"term": {"active": {"value": False}}},
]
data = {"size": 200, "query": {"bool": {"must_not": must_not_list}}}
response, _ = ElasticWrap("ta_video/_search").get(data=data)
missing_rating = [i["_id"] for i in response["hits"]["hits"]]