mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-04 22:39:38 +00:00
fix channel deactivation, take 2
This commit is contained in:
@@ -56,11 +56,11 @@ class YouTubeItem:
|
|||||||
"ta_channel": "channel_active",
|
"ta_channel": "channel_active",
|
||||||
"ta_playlist": "playlist_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 = {
|
data = {
|
||||||
"script": f"ctx._source.{key_match.get(self.index_name)} = false"
|
"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):
|
def del_in_es(self):
|
||||||
"""delete item from elastic search"""
|
"""delete item from elastic search"""
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ class Reindex:
|
|||||||
channel.get_from_youtube()
|
channel.get_from_youtube()
|
||||||
if not channel.json_data:
|
if not channel.json_data:
|
||||||
channel.deactivate()
|
channel.deactivate()
|
||||||
|
channel.get_from_es()
|
||||||
channel.sync_to_videos()
|
channel.sync_to_videos()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user