From fee5e774070078522ca043d8fa401f3ea2f82e90 Mon Sep 17 00:00:00 2001 From: Kieran Date: Fri, 13 Jun 2025 12:21:40 +0100 Subject: [PATCH] fix: missing endpoint id --- crates/zap-stream-db/src/db.rs | 3 ++- crates/zap-stream/src/overseer.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/zap-stream-db/src/db.rs b/crates/zap-stream-db/src/db.rs index 003e032..4b9e9de 100644 --- a/crates/zap-stream-db/src/db.rs +++ b/crates/zap-stream-db/src/db.rs @@ -94,7 +94,7 @@ impl ZapStreamDb { pub async fn update_stream(&self, user_stream: &UserStream) -> Result<()> { sqlx::query( - "update user_stream set state = ?, starts = ?, ends = ?, title = ?, summary = ?, image = ?, thumb = ?, tags = ?, content_warning = ?, goal = ?, pinned = ?, fee = ?, event = ? where id = ?", + "update user_stream set state = ?, starts = ?, ends = ?, title = ?, summary = ?, image = ?, thumb = ?, tags = ?, content_warning = ?, goal = ?, pinned = ?, fee = ?, event = ?, endpoint_id = ? where id = ?", ) .bind(&user_stream.state) .bind(&user_stream.starts) @@ -109,6 +109,7 @@ impl ZapStreamDb { .bind(&user_stream.pinned) .bind(&user_stream.fee) .bind(&user_stream.event) + .bind(&user_stream.endpoint_id) .bind(&user_stream.id) .execute(&self.db) .await diff --git a/crates/zap-stream/src/overseer.rs b/crates/zap-stream/src/overseer.rs index 85a312d..7da388b 100644 --- a/crates/zap-stream/src/overseer.rs +++ b/crates/zap-stream/src/overseer.rs @@ -419,10 +419,10 @@ impl Overseer for ZapStreamOverseer { if let Some(endpoint) = self.db.get_ingest_endpoint(endpoint_id).await? { endpoint.cost } else { - 0 + bail!("Endpoint doesnt exist"); } } else { - 0 + bail!("Endpoint id not set on stream"); }; // Convert duration from seconds to minutes and calculate cost