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"));
|
setDisplayName(performerData.optString("displayName"));
|
||||||
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);
|
||||||
|
|
||||||
onlineState = mapState(chatType);
|
if (!jsonIsOnline) {
|
||||||
if (onlineState == ONLINE) {
|
onlineState = OFFLINE;
|
||||||
if (isStreamAvailable()) {
|
online = false;
|
||||||
if (isAway) {
|
} else {
|
||||||
onlineState = AWAY;
|
onlineState = mapState(chatType);
|
||||||
online = false;
|
if (onlineState == ONLINE) {
|
||||||
|
if (isStreamAvailable()) {
|
||||||
|
if (isAway) {
|
||||||
|
onlineState = AWAY;
|
||||||
|
online = false;
|
||||||
|
} else {
|
||||||
|
online = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
online = true;
|
online = false;
|
||||||
|
onlineState = AWAY;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
online = false;
|
online = false;
|
||||||
onlineState = AWAY;
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
online = false;
|
|
||||||
}
|
}
|
||||||
return online;
|
return online;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue