Skip to content

Commit

Permalink
server: request_lead was doing some work that mark_start_singing shou…
Browse files Browse the repository at this point in the history
…ld have done

When someone request the lead, this should not attempt to destroy the previous song. Other people might still be listening to it, and there could be something going on with the recording. That should wait until someone starts singing.

Fixes #201 (pretty sure)
  • Loading branch information
jeffkaufman committed Jan 24, 2021
1 parent 4b08b53 commit 4f591fa
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ def handle_special(query_params, server_clock, user=None, client_read_clock=None
state.requested_track = requested_track

if query_params.get("mark_start_singing", None):
# Always clear events at the start of a new song.
clear_whole_buffer()
events.clear()

# XXX: There is some confusion over exactly where the start marker should go, but it should be a value that we are guaranteed to have, so the song doesn't fail to start. (So not the write clock.)
Expand Down Expand Up @@ -1074,14 +1074,9 @@ def handle_post(in_json, in_data) -> Tuple[Any, str]:
# accident.
if query_params.get("request_lead", None) and not state.server_controlled:
assign_delays(userid)
state.song_start_clock = 0
state.song_end_clock = 0

state.metronome_on = False
state.leader = userid
state.lyrics = ""
sendall("lyrics", "")
clear_whole_buffer()

# Handle all operations that do not require a userid
handle_special(query_params, server_clock, user, client_read_clock)
Expand Down

0 comments on commit 4f591fa

Please sign in to comment.