Fixed bug in JSON parsing

Some models wouldn't get recorded, because of a missing element in the
JSON doc
This commit is contained in:
0xb00bface 2020-08-08 21:23:38 +02:00
parent caf329eb23
commit b6e4bad837
1 changed files with 2 additions and 3 deletions

View File

@ -95,9 +95,8 @@ public class StripchatModel extends AbstractModel {
best.width = broadcastSettings.optInt("width"); best.width = broadcastSettings.optInt("width");
best.mediaPlaylistUrl = "https://b-" + serverName + ".stripst.com/hls/" + streamName + "/" + streamName + ".m3u8"; best.mediaPlaylistUrl = "https://b-" + serverName + ".stripst.com/hls/" + streamName + "/" + streamName + ".m3u8";
sources.add(best); sources.add(best);
Object resolutionObject = broadcastSettings.get("resolutions"); JSONObject resolutions = broadcastSettings.optJSONObject("resolutions");
if (resolutionObject instanceof JSONObject) { if (resolutions instanceof JSONObject) {
JSONObject resolutions = (JSONObject) resolutionObject;
JSONArray heights = resolutions.names(); JSONArray heights = resolutions.names();
for (int i = 0; i < heights.length(); i++) { for (int i = 0; i < heights.length(); i++) {
String h = heights.getString(i); String h = heights.getString(i);