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,
|
yt_dlp.utils.DownloadError,
|
||||||
):
|
):
|
||||||
print(f"{self.youtube_id}: failed to get info from youtube")
|
print(f"{self.youtube_id}: failed to get info from youtube")
|
||||||
self.youtube_meta = False
|
response = False
|
||||||
|
|
||||||
self.youtube_meta = response
|
self.youtube_meta = response
|
||||||
|
|
||||||
@ -66,10 +66,11 @@ class YouTubeItem:
|
|||||||
|
|
||||||
def deactivate(self):
|
def deactivate(self):
|
||||||
"""deactivate document in es"""
|
"""deactivate document in es"""
|
||||||
|
print(f"{self.youtube_id}: deactivate document")
|
||||||
key_match = {
|
key_match = {
|
||||||
"video": "active",
|
"ta_video": "active",
|
||||||
"channel": "channel_active",
|
"ta_channel": "channel_active",
|
||||||
"playlist": "playlist_active",
|
"ta_playlist": "playlist_active",
|
||||||
}
|
}
|
||||||
update_path = f"{self.index_name}/_update/{self.youtube_id}"
|
update_path = f"{self.index_name}/_update/{self.youtube_id}"
|
||||||
data = {
|
data = {
|
||||||
|
@ -202,7 +202,7 @@ class Reindex:
|
|||||||
|
|
||||||
# get new
|
# get new
|
||||||
video.build_json()
|
video.build_json()
|
||||||
if not video.json_data:
|
if not video.youtube_meta:
|
||||||
video.deactivate()
|
video.deactivate()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user