added custom url label and is protected fields to catalog listing

This commit is contained in:
2026-09-17 18:57:00 +01:00
parent 6ac7e60a34
commit 21a20b898c
+5 -1
View File
@@ -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))