MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / SetStreamLanguage

Method SetStreamLanguage

plugins/twitch/language-selection.cpp:190–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190void LanguageSelection::SetStreamLanguage(const TwitchToken &token) const
191{
192 const auto id = token.GetUserID();
193 if (!id) {
194 vblog(LOG_INFO, "%s skip - invalid user id", __func__);
195 return;
196 }
197
198 OBSDataAutoRelease data = obs_data_create();
199 obs_data_set_string(data, "broadcaster_language", _language.c_str());
200 auto result = SendPatchRequest(token, "https://api.twitch.tv",
201 "/helix/channels",
202 {{"broadcaster_id", *id}}, data.Get());
203
204 if (result.status != 204) {
205 blog(LOG_INFO, "Failed to set stream language! (%d)",
206 result.status);
207 }
208}
209
210static void populateLocaleSelection(QComboBox *list)
211{

Callers 1

PerformActionMethod · 0.80

Calls 4

SendPatchRequestFunction · 0.85
GetMethod · 0.80
GetUserIDMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected