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:
reusedname 2025-03-02 13:34:42 +05:00
parent 0815046351
commit 5a23d95a4b
1 changed files with 18 additions and 10 deletions

View File

@ -65,6 +65,13 @@ public class BongaCamsModel extends AbstractModel {
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);
if (!jsonIsOnline) {
onlineState = OFFLINE;
online = false;
} else {
onlineState = mapState(chatType);
if (onlineState == ONLINE) {
if (isStreamAvailable()) {
@ -81,6 +88,7 @@ public class BongaCamsModel extends AbstractModel {
} else {
online = false;
}
}
return online;
}