mirror of
https://github.com/v0l/zap-stream-core.git
synced 2025-06-16 17:08:50 +00:00
fix: missing endpoint id
This commit is contained in:
@ -94,7 +94,7 @@ impl ZapStreamDb {
|
|||||||
|
|
||||||
pub async fn update_stream(&self, user_stream: &UserStream) -> Result<()> {
|
pub async fn update_stream(&self, user_stream: &UserStream) -> Result<()> {
|
||||||
sqlx::query(
|
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.state)
|
||||||
.bind(&user_stream.starts)
|
.bind(&user_stream.starts)
|
||||||
@ -109,6 +109,7 @@ impl ZapStreamDb {
|
|||||||
.bind(&user_stream.pinned)
|
.bind(&user_stream.pinned)
|
||||||
.bind(&user_stream.fee)
|
.bind(&user_stream.fee)
|
||||||
.bind(&user_stream.event)
|
.bind(&user_stream.event)
|
||||||
|
.bind(&user_stream.endpoint_id)
|
||||||
.bind(&user_stream.id)
|
.bind(&user_stream.id)
|
||||||
.execute(&self.db)
|
.execute(&self.db)
|
||||||
.await
|
.await
|
||||||
|
@ -419,10 +419,10 @@ impl Overseer for ZapStreamOverseer {
|
|||||||
if let Some(endpoint) = self.db.get_ingest_endpoint(endpoint_id).await? {
|
if let Some(endpoint) = self.db.get_ingest_endpoint(endpoint_id).await? {
|
||||||
endpoint.cost
|
endpoint.cost
|
||||||
} else {
|
} else {
|
||||||
0
|
bail!("Endpoint doesnt exist");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
0
|
bail!("Endpoint id not set on stream");
|
||||||
};
|
};
|
||||||
|
|
||||||
// Convert duration from seconds to minutes and calculate cost
|
// Convert duration from seconds to minutes and calculate cost
|
||||||
|
Reference in New Issue
Block a user