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
|
||||
pub fn get_media_map(media: Media) -> Value {
|
||||
json!({
|
||||
"title": media.title,
|
||||
let mut obj = json!({
|
||||
"in": media.seek,
|
||||
"out": media.out,
|
||||
"duration": media.duration,
|
||||
"category": media.category,
|
||||
"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
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 6111c2686d14b3bf33a4c0b29c85672f7e4f4399
|
||||
Subproject commit 05d0ada8e155a9bf858a26fcda219fb39782cf05
|
@ -65,7 +65,7 @@ pub struct Media {
|
||||
|
||||
#[serde(skip_serializing, skip_deserializing)]
|
||||
pub index: Option<usize>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub title: Option<String>,
|
||||
#[serde(rename = "in")]
|
||||
pub seek: f64,
|
||||
|
Loading…
x
Reference in New Issue
Block a user