feat: Emit sound play count change event to connected clients after playing a sound
This commit is contained in:
@@ -46,6 +46,14 @@ class SocketIOService:
|
||||
{"credits": new_credits},
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def emit_sound_play_count_changed(sound_id: int, new_play_count: int) -> None:
|
||||
"""Emit sound_play_count_changed event to all connected clients."""
|
||||
SocketIOService.emit_to_all(
|
||||
"sound_play_count_changed",
|
||||
{"sound_id": sound_id, "play_count": new_play_count},
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def emit_credits_required(user_id: int, credits_needed: int) -> None:
|
||||
"""Emit an event when credits are required."""
|
||||
|
||||
Reference in New Issue
Block a user