better error messages for failed index, #858

This commit is contained in:
Simon
2025-01-24 21:31:59 +07:00
parent bde706cc5e
commit a8336ed04d
3 changed files with 10 additions and 3 deletions

View File

@@ -407,8 +407,11 @@ class ManualImport:
media_path=self.current_video["media"],
)
if not video.json_data:
print(f"{video_id}: manual import failed, and no metadata found.")
raise ValueError
message = (
f"{video_id}: manual import failed, and no metadata found."
)
print(message)
raise ValueError(message)
video.check_subtitles(subtitle_files=self.current_video["subtitle"])
video.upload_to_es()

View File

@@ -42,6 +42,10 @@ class YoutubeChannel(YouTubeItem):
if not self.youtube_meta and fallback:
self._video_fallback(fallback)
else:
if not self.json_data:
message = f"{self.youtube_id}: Failed to get metadata"
raise ValueError(message)
self.process_youtube_meta()
self.get_channel_art()

View File

@@ -1,6 +1,6 @@
-r requirements.txt
ipython==8.31.0
pre-commit==4.0.1
pre-commit==4.1.0
pylint-django==2.6.1
pylint==3.3.3
pytest-django==4.9.0