query caps only when using them in response

This commit is contained in:
Roland Osborne 2022-09-01 10:05:06 -07:00
parent 7f2b788208
commit ac728373b7

View File

@ -50,10 +50,6 @@ func GetChannels(w http.ResponseWriter, r *http.Request) {
}
}
video := getBoolConfigValue(CNFEnableVideo, true);
audio := getBoolConfigValue(CNFEnableAudio, true);
image := getBoolConfigValue(CNFEnableImage, true);
response := []*Channel{}
tokenType := ParamTokenType(r)
if tokenType == APPTokenAgent {
@ -84,6 +80,9 @@ func GetChannels(w http.ResponseWriter, r *http.Request) {
if channelRevisionSet {
response = append(response, getChannelRevisionModel(&slot, true))
} else if slot.Channel != nil {
video := getBoolConfigValue(CNFEnableVideo, true);
audio := getBoolConfigValue(CNFEnableAudio, true);
image := getBoolConfigValue(CNFEnableImage, true);
response = append(response, getChannelModel(&slot, true, true, image, audio, video))
}
}
@ -128,6 +127,9 @@ func GetChannels(w http.ResponseWriter, r *http.Request) {
if channelRevisionSet {
response = append(response, getChannelRevisionModel(&slot, shared))
} else if shared {
video := getBoolConfigValue(CNFEnableVideo, true);
audio := getBoolConfigValue(CNFEnableAudio, true);
image := getBoolConfigValue(CNFEnableImage, true);
response = append(response, getChannelModel(&slot, true, false, image, audio, video))
}
}