From b48b7c7e72694c038826ef1a27724e258eb8d7dc Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 22 Nov 2022 10:17:44 +0700 Subject: [PATCH] fix channel deactivation, take 2 --- tubearchivist/home/src/index/generic.py | 4 ++-- tubearchivist/home/src/index/reindex.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tubearchivist/home/src/index/generic.py b/tubearchivist/home/src/index/generic.py index 099c5d4..105f66b 100644 --- a/tubearchivist/home/src/index/generic.py +++ b/tubearchivist/home/src/index/generic.py @@ -56,11 +56,11 @@ class YouTubeItem: "ta_channel": "channel_active", "ta_playlist": "playlist_active", } - update_path = f"{self.index_name}/_update/{self.youtube_id}" + path = f"{self.index_name}/_update/{self.youtube_id}?refresh=true" data = { "script": f"ctx._source.{key_match.get(self.index_name)} = false" } - _, _ = ElasticWrap(update_path).post(data) + _, _ = ElasticWrap(path).post(data) def del_in_es(self): """delete item from elastic search""" diff --git a/tubearchivist/home/src/index/reindex.py b/tubearchivist/home/src/index/reindex.py index 6e085cd..a372b5b 100644 --- a/tubearchivist/home/src/index/reindex.py +++ b/tubearchivist/home/src/index/reindex.py @@ -196,6 +196,7 @@ class Reindex: channel.get_from_youtube() if not channel.json_data: channel.deactivate() + channel.get_from_es() channel.sync_to_videos() return