Update StripchatModel.java
This commit is contained in:
parent
5c89e9e1bc
commit
2fdc30fd46
|
@ -48,25 +48,30 @@ public class StripchatModel extends AbstractModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOnline(boolean ignoreCache) throws IOException, ExecutionException, InterruptedException {
|
public boolean isOnline(boolean ignoreCache) throws IOException, ExecutionException, InterruptedException {
|
||||||
JSONObject info = getModelInfo();
|
if (ignoreCache) {
|
||||||
if (ignoreCache && info.has("user")) {
|
JSONObject jsonResponse = getModelInfo();
|
||||||
JSONObject user = info.getJSONObject("user").getJSONObject("user");
|
if (jsonResponse.has("user")) {
|
||||||
if (info.has("cam")) {
|
JSONObject user = jsonResponse.getJSONObject("user").getJSONObject("user");
|
||||||
JSONObject cam = info.getJSONObject("cam");
|
String status = user.optString("status");
|
||||||
|
mapOnlineState(status);
|
||||||
|
if (onlineState == OFFLINE) {
|
||||||
|
setLastSeen(user.optString("statusChangedAt"));
|
||||||
|
}
|
||||||
|
if (isBanned(user)) {
|
||||||
|
log.debug("Model inactive or deleted: {}", getName());
|
||||||
|
setMarkedForLaterRecording(true);
|
||||||
|
}
|
||||||
|
if ((onlineState == PRIVATE) && jsonResponse.has("cam")) {
|
||||||
|
JSONObject cam = jsonResponse.getJSONObject("cam");
|
||||||
|
if (StringUtil.isNotBlank(cam.optString(KEY_MODEL_TOKEN))) {
|
||||||
|
setOnlineState(ONLINE);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
String status = user.optString("status");
|
if (jsonResponse.optString("error").equals("Not Found")) {
|
||||||
mapOnlineState(status);
|
|
||||||
if (onlineState == OFFLINE) {
|
|
||||||
setLastSeen(user.optString("statusChangedAt"));
|
|
||||||
}
|
|
||||||
if (isBanned(user)) {
|
|
||||||
log.debug("Model inactive or deleted: {}", getName());
|
|
||||||
// Config.getInstance().setModelNotes(this, "Model inactive or deleted"); <- from v5.0.24
|
|
||||||
setMarkedForLaterRecording(true);
|
setMarkedForLaterRecording(true);
|
||||||
}
|
setOnlineState(OFFLINE);
|
||||||
if (onlineState == PRIVATE && StringUtil.isNotBlank((cam.optString(KEY_MODEL_TOKEN))) {
|
|
||||||
setOnlineState(ONLINE);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return onlineState == ONLINE;
|
return onlineState == ONLINE;
|
||||||
|
|
Loading…
Reference in New Issue