mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-06-06 21:23:14 +00:00
Add extension on the transcoder info
This commit is contained in:
@@ -110,6 +110,10 @@ export const WatchInfoP = z.object({
|
|||||||
* The internal path of the video file.
|
* The internal path of the video file.
|
||||||
*/
|
*/
|
||||||
path: z.string(),
|
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.
|
* The container of the video file of this episode. Common containers are mp4, mkv, avi and so on.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ pub struct MediaInfo {
|
|||||||
pub sha: String,
|
pub sha: String,
|
||||||
/// The internal path of the video file.
|
/// The internal path of the video file.
|
||||||
pub path: String,
|
pub path: String,
|
||||||
|
/// The extension currently used to store this video file
|
||||||
|
pub extension: String,
|
||||||
/// The length of the media in seconds.
|
/// The length of the media in seconds.
|
||||||
pub length: f32,
|
pub length: f32,
|
||||||
/// The container of the video file of this episode.
|
/// The container of the video file of this episode.
|
||||||
@@ -203,6 +205,7 @@ 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(),
|
||||||
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"]
|
||||||
|
|||||||
Reference in New Issue
Block a user