diff --git a/front/packages/models/src/resources/watch-info.ts b/front/packages/models/src/resources/watch-info.ts index 116ba71e..b0b0e32f 100644 --- a/front/packages/models/src/resources/watch-info.ts +++ b/front/packages/models/src/resources/watch-info.ts @@ -110,6 +110,10 @@ export const WatchInfoP = z.object({ * The internal path of the video file. */ path: z.string(), + /** + * The extension used to store this video file. + */ + extension: z.string(), /** * The container of the video file of this episode. Common containers are mp4, mkv, avi and so on. */ diff --git a/transcoder/src/identify.rs b/transcoder/src/identify.rs index 5fd809a2..2ef916d7 100644 --- a/transcoder/src/identify.rs +++ b/transcoder/src/identify.rs @@ -20,6 +20,8 @@ pub struct MediaInfo { pub sha: String, /// The internal path of the video file. pub path: String, + /// The extension currently used to store this video file + pub extension: String, /// The length of the media in seconds. pub length: f32, /// The container of the video file of this episode. @@ -203,6 +205,7 @@ pub async fn identify(path: String) -> Option { Some(MediaInfo { length: parse::(&general["Duration"])?, + extension: Path::new(path).extension(), container: general["Format"].as_str().unwrap().to_string(), video: { let v = output["media"]["track"]