fix reindex and deactivate error

This commit is contained in:
simon 2022-02-13 10:05:08 +07:00
parent 8f87c4774a
commit 8fce31b983
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
2 changed files with 6 additions and 5 deletions

View File

@ -49,7 +49,7 @@ class YouTubeItem:
yt_dlp.utils.DownloadError,
):
print(f"{self.youtube_id}: failed to get info from youtube")
self.youtube_meta = False
response = False
self.youtube_meta = response
@ -66,10 +66,11 @@ class YouTubeItem:
def deactivate(self):
"""deactivate document in es"""
print(f"{self.youtube_id}: deactivate document")
key_match = {
"video": "active",
"channel": "channel_active",
"playlist": "playlist_active",
"ta_video": "active",
"ta_channel": "channel_active",
"ta_playlist": "playlist_active",
}
update_path = f"{self.index_name}/_update/{self.youtube_id}"
data = {

View File

@ -202,7 +202,7 @@ class Reindex:
# get new
video.build_json()
if not video.json_data:
if not video.youtube_meta:
video.deactivate()
return