refactor: update room info before handling status changes

This commit is contained in:
acgnhik 2022-12-31 20:50:50 +08:00
parent 34d9aa63ef
commit 60a8f23a14

View File

@ -122,8 +122,10 @@ class LiveMonitor(EventEmitter[LiveEventListener], DanmakuListener, SwitchableMi
danmu_cmd = danmu['cmd'] danmu_cmd = danmu['cmd']
if danmu_cmd == DanmakuCommand.LIVE.value: if danmu_cmd == DanmakuCommand.LIVE.value:
await self._live.update_room_info()
await self._handle_status_change(LiveStatus.LIVE) await self._handle_status_change(LiveStatus.LIVE)
elif danmu_cmd == DanmakuCommand.PREPARING.value: elif danmu_cmd == DanmakuCommand.PREPARING.value:
await self._live.update_room_info()
if danmu.get('round', None) == 1: if danmu.get('round', None) == 1:
await self._handle_status_change(LiveStatus.ROUND) await self._handle_status_change(LiveStatus.ROUND)
else: else: