diff --git a/net/server/internal/api_getChannels.go b/net/server/internal/api_getChannels.go index d123f74a..8029bb5d 100644 --- a/net/server/internal/api_getChannels.go +++ b/net/server/internal/api_getChannels.go @@ -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)) } }