mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 11:50:14 +00:00
fix reindex and deactivate error
This commit is contained in:
parent
8f87c4774a
commit
8fce31b983
@ -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 = {
|
||||
|
@ -202,7 +202,7 @@ class Reindex:
|
||||
|
||||
# get new
|
||||
video.build_json()
|
||||
if not video.json_data:
|
||||
if not video.youtube_meta:
|
||||
video.deactivate()
|
||||
return
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user