fix: missing endpoint id

This commit is contained in:
2025-06-13 12:21:40 +01:00
parent d88f829645
commit fee5e77407
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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