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
|
@ -64,22 +64,30 @@ public class BongaCamsModel extends AbstractModel {
|
|||
setDisplayName(performerData.optString("displayName"));
|
||||
String chatType = performerData.optString("showType");
|
||||
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);
|
||||
|
||||
onlineState = mapState(chatType);
|
||||
if (onlineState == ONLINE) {
|
||||
if (isStreamAvailable()) {
|
||||
if (isAway) {
|
||||
onlineState = AWAY;
|
||||
online = false;
|
||||
if (!jsonIsOnline) {
|
||||
onlineState = OFFLINE;
|
||||
online = false;
|
||||
} else {
|
||||
onlineState = mapState(chatType);
|
||||
if (onlineState == ONLINE) {
|
||||
if (isStreamAvailable()) {
|
||||
if (isAway) {
|
||||
onlineState = AWAY;
|
||||
online = false;
|
||||
} else {
|
||||
online = true;
|
||||
}
|
||||
} else {
|
||||
online = true;
|
||||
online = false;
|
||||
onlineState = AWAY;
|
||||
}
|
||||
} else {
|
||||
online = false;
|
||||
onlineState = AWAY;
|
||||
}
|
||||
} else {
|
||||
online = false;
|
||||
}
|
||||
return online;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue