Cleanup: over-engineering pass
- merge /api/uptime + /api/version into /api/health and /api/stats - collapse RTMP per-codec dispatch into a single CodecParser path - dedupe STUN attribute walking (ufrag_pair / parse_xor_mapped_address) - dedupe StreamCodec <-> str0m Codec mapping via StreamCodec::from_str0m - dedupe bearer token extraction in WHIP handlers - replace regex charset validation with stdlib checks - flatten one-field wrappers (WebRtcProxyConfig, HttpServerConfig, ServerInfo) - remove SessionCookie extractor (only fed debug logs) - delete dead code: entity ActiveModel helpers, get_stream_session, WebrtcProxy::local_addr, _connected flag, commented-out blocks - drop unused deps: futures, rand, regex, serde_json
This commit is contained in:
@@ -50,17 +50,6 @@ impl Model {
|
||||
.insert(db)
|
||||
.await
|
||||
}
|
||||
pub async fn get_stream_session(
|
||||
db: &DatabaseConnection,
|
||||
stream_session_id: i32,
|
||||
) -> Result<Model, DbErr> {
|
||||
Entity::find_by_id(stream_session_id)
|
||||
.one(db)
|
||||
.await?
|
||||
.ok_or(DbErr::RecordNotFound(format!(
|
||||
"stream_session {stream_session_id}"
|
||||
)))
|
||||
}
|
||||
pub async fn get_all_active_sessions(db: &DatabaseConnection) -> Result<Vec<Model>, DbErr> {
|
||||
Ok(Entity::find()
|
||||
.filter(Column::EndedAt.is_null())
|
||||
|
||||
Reference in New Issue
Block a user