WIP create a video type inference method and a mapping into a content type.
This commit is contained in:
@@ -7,6 +7,7 @@ use actix_web::{get, web, HttpResponse, Responder};
|
||||
use actix_web_httpauth::middleware::HttpAuthentication;
|
||||
|
||||
pub mod user;
|
||||
pub mod video;
|
||||
|
||||
#[get("/health")]
|
||||
async fn health() -> impl Responder {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
pub mod video_format_content_type_mapper;
|
||||
@@ -0,0 +1,11 @@
|
||||
use surveillant_systeme_domain::video::model::VideoFormat;
|
||||
|
||||
pub fn map_to_content_type(video_format: &VideoFormat) -> &'static str {
|
||||
match video_format {
|
||||
VideoFormat::AVI => "video/x-msvideo",
|
||||
VideoFormat::MKV => "video/x-matroska",
|
||||
VideoFormat::MP4 => "video/mp4",
|
||||
VideoFormat::WEBM => "video/webm",
|
||||
VideoFormat::UNKNOWN => "application/octet-stream"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user