File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ use askama_actix::TemplateToResponse;
2121use chrono:: { Duration , Utc } ;
2222use futures:: { future:: ready, StreamExt , TryStreamExt } ;
2323use futures_util:: Stream ;
24- use mime_guess:: mime:: { self , APPLICATION_OCTET_STREAM , IMAGE } ;
24+ use mime_guess:: mime:: { self , APPLICATION_OCTET_STREAM , IMAGE , VIDEO } ;
2525use rand:: distributions:: { Alphanumeric , DistString } ;
2626use serde:: Deserialize ;
2727use syntect:: { html:: ClassedHTMLGenerator , parsing:: SyntaxSet , util:: LinesWithEndings } ;
@@ -203,6 +203,24 @@ async fn get_ext(
203203 }
204204 . to_response ( )
205205 }
206+ Some ( mime) if mime. type_ ( ) == VIDEO => {
207+ #[ derive( Template ) ]
208+ #[ template( path = "video.html" ) ]
209+ struct Video {
210+ file_name : FileName ,
211+ delete_at : Option < DateTime > ,
212+ owner : bool ,
213+ copy : Option < String > ,
214+ }
215+
216+ Video {
217+ file_name,
218+ delete_at,
219+ owner,
220+ copy : None ,
221+ }
222+ . to_response ( )
223+ }
206224 _ if file. len ( ) < 50_000 => {
207225 if let Ok ( file) =
208226 String :: from_utf8 ( file. to_vec ( ) . await . map_err ( ErrorInternalServerError ) ?)
Original file line number Diff line number Diff line change 1+ {% extends "get.html" %}
2+
3+ {% block file %}
4+ < video src ="raw/{{ file_name }} " alt ="Shared Video " autoplay controls >
5+ {% endblock %}
You can’t perform that action at this time.
0 commit comments