Skip to content

Commit

Permalink
streamer: do things in the correct order
Browse files Browse the repository at this point in the history
  • Loading branch information
Wessie committed May 18, 2024
1 parent 508290b commit 4e43f25
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions streamer/streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ func NewStreamer(ctx context.Context, cfg config.Config, qs radio.QueueService,
SampleRate: 44100,
}

// user value to tell us who is streaming according to the proxy
s.userValue = util.StreamValue(ctx, cfg.Manager.CurrentUser, s.userChange)
// timer we use for starting the streamer if nobody is on
s.startTimer = util.NewCallbackTimer(func() {
s.Start(ctx)
Expand All @@ -89,6 +87,9 @@ func NewStreamer(ctx context.Context, cfg config.Config, qs radio.QueueService,
s.StreamUser = *user

zerolog.Ctx(ctx).Info().Str("username", user.Username).Msg("this is me")

// user value to tell us who is streaming according to the proxy
s.userValue = util.StreamValue(ctx, cfg.Manager.CurrentUser, s.userChange)
return s, nil
}

Expand Down

0 comments on commit 4e43f25

Please sign in to comment.