Add extension on the transcoder info

This commit is contained in:
Zoe Roux 2023-12-15 19:30:26 +01:00
parent dd62f8f8ac
commit 2603c1b29d
2 changed files with 7 additions and 0 deletions

View File

@ -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.
*/

View File

@ -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<MediaInfo> {
Some(MediaInfo {
length: parse::<f32>(&general["Duration"])?,
extension: Path::new(path).extension(),
container: general["Format"].as_str().unwrap().to_string(),
video: {
let v = output["media"]["track"]