Improve Bongacams online check
- check new (?) field isOnline before attempting to get stream sources (was failing due to missing json field when offline)
This commit is contained in:
parent
0815046351
commit
5a23d95a4b
|
@ -65,6 +65,13 @@ public class BongaCamsModel extends AbstractModel {
|
||||||
String chatType = performerData.optString("showType");
|
String chatType = performerData.optString("showType");
|
||||||
boolean isAway = performerData.optBoolean("isAway");
|
boolean isAway = performerData.optBoolean("isAway");
|
||||||
|
|
||||||
|
// looks like isOnline key is new. Treat it's absence as true (old behavior)
|
||||||
|
boolean jsonIsOnline = performerData.optBoolean("isOnline", true);
|
||||||
|
|
||||||
|
if (!jsonIsOnline) {
|
||||||
|
onlineState = OFFLINE;
|
||||||
|
online = false;
|
||||||
|
} else {
|
||||||
onlineState = mapState(chatType);
|
onlineState = mapState(chatType);
|
||||||
if (onlineState == ONLINE) {
|
if (onlineState == ONLINE) {
|
||||||
if (isStreamAvailable()) {
|
if (isStreamAvailable()) {
|
||||||
|
@ -81,6 +88,7 @@ public class BongaCamsModel extends AbstractModel {
|
||||||
} else {
|
} else {
|
||||||
online = false;
|
online = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return online;
|
return online;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue