部分小问题的修改

This commit is contained in:
2025-05-20 17:03:14 +08:00
parent 6dd18ae1e0
commit 86c6669593
7 changed files with 32 additions and 17 deletions

View File

@ -9,14 +9,17 @@ class SocketManager:
if room not in self.rooms:
self.rooms[room] = []
self.rooms[room].append(websocket)
if room.startswith('pict_op'):
websocket.send_text(str(len(self.rooms[room])))
async def remove_from_room(self, room: str, websocket: WebSocket):
if room in self.rooms:
self.rooms[room].remove(websocket)
if len(self.rooms[room]) == 0:
del self.rooms[room]
if room.startswith('detect_rtsp_'):
print()
else:
if room.startswith('pict_op'):
websocket.send_text(str(len(self.rooms[room])))
async def broadcast_to_room(self, room: str, message: str, exclude_websocket: WebSocket = None):
if room in self.rooms: