added custom url label and is protected fields to catalog listing
This commit is contained in:
@@ -125,9 +125,11 @@ impl HttpServer {
|
|||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
struct StreamListing {
|
struct StreamListing {
|
||||||
label: String,
|
label: String,
|
||||||
|
custom_url_label: String,
|
||||||
id: i32,
|
id: i32,
|
||||||
user: String,
|
user: String,
|
||||||
started_at: DateTime<Utc>, //UNIX TIMESTAMP
|
started_at: DateTime<Utc>,
|
||||||
|
is_password_protected: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
@@ -252,8 +254,10 @@ async fn catalog_handler(
|
|||||||
.map(|x| StreamListing {
|
.map(|x| StreamListing {
|
||||||
id: x.stream_key_id,
|
id: x.stream_key_id,
|
||||||
label: x.stream_key_label.clone(),
|
label: x.stream_key_label.clone(),
|
||||||
|
custom_url_label: x.custom_id.clone().unwrap_or_default(),
|
||||||
user: x.stream_key_user.clone(),
|
user: x.stream_key_user.clone(),
|
||||||
started_at: x.started_at,
|
started_at: x.started_at,
|
||||||
|
is_password_protected: x.password.is_some(),
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
Ok(Json(catalog))
|
Ok(Json(catalog))
|
||||||
|
|||||||
Reference in New Issue
Block a user