WIP create a video type inference method and a mapping into a content type.

This commit is contained in:
Florian THIERRY
2026-07-13 23:26:51 +02:00
parent 03dbbb9ac9
commit 850dbca6cf
12 changed files with 354 additions and 28 deletions
+1
View File
@@ -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 {
+1
View File
@@ -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"
}
}