| 88 | } |
| 89 | |
| 90 | static std::vector<std::string> |
| 91 | getStringArrayHelper(const OBSDataAutoRelease &data, const std::string &value) |
| 92 | { |
| 93 | std::vector<std::string> result; |
| 94 | auto jsonStr = obs_data_get_json(data); |
| 95 | if (!jsonStr) { |
| 96 | return result; |
| 97 | } |
| 98 | try { |
| 99 | auto json = nlohmann::json::parse(jsonStr); |
| 100 | auto &array = json[value]; |
| 101 | if (!array.is_array()) { |
| 102 | return result; |
| 103 | } |
| 104 | for (const auto &element : array) { |
| 105 | std::string strElement = element.get<std::string>(); |
| 106 | result.emplace_back(strElement); |
| 107 | } |
| 108 | } catch (const nlohmann::json::exception &) { |
| 109 | } |
| 110 | return result; |
| 111 | } |
| 112 | |
| 113 | std::optional<ChannelLiveInfo> |
| 114 | TwitchChannel::GetLiveInfo(const TwitchToken &token) const |
no outgoing calls
no test coverage detected