update frontend, make title optional
This commit is contained in:
parent
441af894c2
commit
fbe810bb0b
@ -251,14 +251,21 @@ pub fn prepare_output_cmd(
|
|||||||
|
|
||||||
/// map media struct to json object
|
/// map media struct to json object
|
||||||
pub fn get_media_map(media: Media) -> Value {
|
pub fn get_media_map(media: Media) -> Value {
|
||||||
json!({
|
let mut obj = json!({
|
||||||
"title": media.title,
|
|
||||||
"in": media.seek,
|
"in": media.seek,
|
||||||
"out": media.out,
|
"out": media.out,
|
||||||
"duration": media.duration,
|
"duration": media.duration,
|
||||||
"category": media.category,
|
"category": media.category,
|
||||||
"source": media.source,
|
"source": media.source,
|
||||||
})
|
});
|
||||||
|
|
||||||
|
if let Some(title) = media.title {
|
||||||
|
obj.as_object_mut()
|
||||||
|
.unwrap()
|
||||||
|
.insert("title".to_string(), Value::String(title));
|
||||||
|
}
|
||||||
|
|
||||||
|
obj
|
||||||
}
|
}
|
||||||
|
|
||||||
/// prepare json object for response
|
/// prepare json object for response
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 6111c2686d14b3bf33a4c0b29c85672f7e4f4399
|
Subproject commit 05d0ada8e155a9bf858a26fcda219fb39782cf05
|
@ -65,7 +65,7 @@ pub struct Media {
|
|||||||
|
|
||||||
#[serde(skip_serializing, skip_deserializing)]
|
#[serde(skip_serializing, skip_deserializing)]
|
||||||
pub index: Option<usize>,
|
pub index: Option<usize>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||||
pub title: Option<String>,
|
pub title: Option<String>,
|
||||||
#[serde(rename = "in")]
|
#[serde(rename = "in")]
|
||||||
pub seek: f64,
|
pub seek: f64,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user