Skip to content

Commit

Permalink
feat: save youtube thumbnail info
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Aug 8, 2024
1 parent 10a427c commit a9246f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xmodule/video_block/video_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,9 @@ def editor_saved(self, user, old_metadata, old_content): # lint-amnesty, pylint
if val_youtube_id and self.youtube_id_1_0 != val_youtube_id:
self.youtube_id_1_0 = val_youtube_id

if self.youtube_id_1_0:
self.thumbnail = f"https://img.youtube.com/vi/{self.youtube_id_1_0}/sddefault.jpg"

manage_video_subtitles_save(
self,
user,
Expand Down Expand Up @@ -1120,6 +1123,7 @@ def index_dictionary(self):
xblock_body = super().index_dictionary()
video_body = {
"display_name": self.display_name,
"thumbnail": self.thumbnail,
}

def _update_transcript_for_index(language=None):
Expand Down

0 comments on commit a9246f2

Please sign in to comment.