Phase 3.5: Finalized UI polish, added Console, and fixed stale stream status bug

This commit is contained in:
2026-03-18 11:37:16 +08:00
parent 38bc9526b2
commit d05ec7ccdf
6 changed files with 223 additions and 97 deletions

View File

@@ -72,8 +72,8 @@ func NewRTMPServer() *RTMPServer {
s.channels[roomLivePath] = q
s.mutex.Unlock()
// Mark room as active in DB
db.DB.Model(&room).Update("is_active", true)
// Mark room as active in DB (using map to ensure true/false is correctly updated)
db.DB.Model(&room).Updates(map[string]interface{}{"is_active": true})
// 3. Cleanup on end
defer func() {
@@ -81,7 +81,8 @@ func NewRTMPServer() *RTMPServer {
delete(s.channels, roomLivePath)
s.mutex.Unlock()
q.Close()
db.DB.Model(&room).Update("is_active", false) // Mark room as inactive
// Explicitly set is_active to false using map
db.DB.Model(&room).Updates(map[string]interface{}{"is_active": false})
fmt.Printf("[INFO] Publishing ended for Room ID: %d\n", room.ID)
}()