Fix minor bugs discovered during alpha test

This commit is contained in:
Dmitrii Okunev
2024-10-24 19:13:50 +01:00
parent 40991af680
commit 014f67aa44
3 changed files with 10 additions and 0 deletions

View File

@@ -24,6 +24,9 @@ func Eval[T any](
} }
value := buf.String() value := buf.String()
if value == "" {
return result, nil
}
_, err = fmt.Sscanf(value, "%v", &result) _, err = fmt.Sscanf(value, "%v", &result)
if err != nil { if err != nil {
return result, fmt.Errorf("unable to scan value '%v' into %T: %w", value, result, err) return result, fmt.Errorf("unable to scan value '%v' into %T: %w", value, result, err)

View File

@@ -635,6 +635,9 @@ func (yt *YouTube) StartStream(
templateBroadcastIDs, templateBroadcastIDs,
customArgs, customArgs,
) )
if len(templateBroadcastIDs) == 0 {
return fmt.Errorf("no template stream is selected")
}
templateBroadcastIDMap := map[string]struct{}{} templateBroadcastIDMap := map[string]struct{}{}
for _, broadcastID := range templateBroadcastIDs { for _, broadcastID := range templateBroadcastIDs {

View File

@@ -3532,6 +3532,10 @@ func (p *Panel) profileWindow(
youtubeProfile.Tags = sanitizeTags(getYoutubeTags()) youtubeProfile.Tags = sanitizeTags(getYoutubeTags())
} }
profile.PerPlatform[youtube.ID] = youtubeProfile profile.PerPlatform[youtube.ID] = youtubeProfile
if len(youtubeProfile.TemplateBroadcastIDs) == 0 {
p.DisplayError(fmt.Errorf("no youtube template stream is selected"))
return
}
} }
err := commitFn(ctx, profile) err := commitFn(ctx, profile)
if err != nil { if err != nil {