From dfacc3039aeaeaa47e27dda128c91017020fc110 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 14 Sep 2022 16:43:48 +0700 Subject: [PATCH] fix reindex task, skip inactive in _get_unrated_vids --- tubearchivist/home/src/index/reindex.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tubearchivist/home/src/index/reindex.py b/tubearchivist/home/src/index/reindex.py index db231f89..ac0c363e 100644 --- a/tubearchivist/home/src/index/reindex.py +++ b/tubearchivist/home/src/index/reindex.py @@ -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"]]