mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 04:04:21 -04:00
Fix extension extraction
This commit is contained in:
parent
71d29a303f
commit
fb04daff9f
@ -4,7 +4,7 @@ use serde::Serialize;
|
|||||||
use std::{
|
use std::{
|
||||||
collections::{hash_map::DefaultHasher, HashMap},
|
collections::{hash_map::DefaultHasher, HashMap},
|
||||||
hash::{Hash, Hasher},
|
hash::{Hash, Hasher},
|
||||||
path::PathBuf,
|
path::{Path, PathBuf},
|
||||||
process::Stdio,
|
process::Stdio,
|
||||||
str::{self, FromStr},
|
str::{self, FromStr},
|
||||||
};
|
};
|
||||||
@ -205,7 +205,10 @@ pub async fn identify(path: String) -> Option<MediaInfo> {
|
|||||||
|
|
||||||
Some(MediaInfo {
|
Some(MediaInfo {
|
||||||
length: parse::<f32>(&general["Duration"])?,
|
length: parse::<f32>(&general["Duration"])?,
|
||||||
extension: Path::new(path).extension(),
|
extension: Path::new(&path)
|
||||||
|
.extension()
|
||||||
|
.map(|x| x.to_os_string().into_string().unwrap())
|
||||||
|
.unwrap_or(String::from(".mkv")),
|
||||||
container: general["Format"].as_str().unwrap().to_string(),
|
container: general["Format"].as_str().unwrap().to_string(),
|
||||||
video: {
|
video: {
|
||||||
let v = output["media"]["track"]
|
let v = output["media"]["track"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user