Displaying captions on video page.

This commit is contained in:
Roland 2022-01-25 10:16:29 -07:00
parent 0315def174
commit 93204a0b2a
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
3 changed files with 10 additions and 2 deletions

View file

@ -97,7 +97,13 @@ function VideoPage(props) {
</Tab.Pane>
}
let tabPanes = [descriptionPane, statisticsPane];
let captionsPane = {
menuItem: 'Captions', render: () => <Tab.Pane>
<pre>{video.caption}</pre>
</Tab.Pane>
};
let tabPanes = [descriptionPane, statisticsPane, captionsPane];
return (
<Container textAlign='left'>

View file

@ -116,7 +116,7 @@ class Video(ModelHelper, Base):
"""
Add this video to it's Channel's skip list.
"""
if self.channel:
if self.channel and self.source_id:
self.channel.add_video_to_skip_list(self.source_id)
def set_favorite(self, favorite: bool) -> Optional[datetime]:

View file

@ -31,7 +31,9 @@ def get_video_for_app(video_id: int) -> Tuple[dict, Optional[dict], Optional[dic
video.set_viewed()
previous_video, next_video = video.get_surrounding_videos()
caption = video.caption
video = video.__json__()
video['caption'] = caption
previous_video = previous_video.__json__() if previous_video else None
next_video = next_video.__json__() if next_video else None