Linking to /download for files that should be downloaded.

This commit is contained in:
Roland 2022-12-15 14:25:47 -07:00
parent a5856309ed
commit 336f732633
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
4 changed files with 46 additions and 14 deletions

View file

@ -70,6 +70,7 @@ function VideoPage({videoFile, prevFile, nextFile, setFavorite, ...props}) {
}
let videoUrl = `${MEDIA_PATH}/${encodeURIComponent(video.video_path)}`;
let downloadUrl = `/download/${encodeURIComponent(video.video_path)}`;
let posterUrl = video.poster_path ? `${MEDIA_PATH}/${encodeURIComponent(video.poster_path)}` : null;
let captionsUrl = video.caption_path ? `${MEDIA_PATH}/${encodeURIComponent(video.caption_path)}` : null;
@ -184,7 +185,7 @@ function VideoPage({videoFile, prevFile, nextFile, setFavorite, ...props}) {
<p>
{favorite_button}
<a href={videoUrl}>
<a href={downloadUrl} target='_blank' rel='noopener noreferrer'>
<Button style={{margin: '0.5em'}}>
<Icon name='download'/>
Download