forked from j62/ctbrec
1
0
Fork 0

Improve Showup online detection

This commit is contained in:
0xboobface 2020-05-20 18:18:29 +02:00
parent e096e8555f
commit c05785cd20
1 changed files with 10 additions and 1 deletions

View File

@ -31,14 +31,23 @@ public class ShowupModel extends AbstractModel {
@Override
public boolean isOnline(boolean ignoreCache) throws IOException, ExecutionException, InterruptedException {
if(ignoreCache) {
if (ignoreCache) {
boolean foundInList = false;
List<Model> modelList = getShowupSite().getModelList();
for (Model model : modelList) {
ShowupModel m = (ShowupModel) model;
if (m.getUid() == uid) {
setOnlineState(m.getOnlineState(false));
setStreamId(m.getStreamId());
setStreamTranscoderAddr(m.getStreamTranscoderAddr());
setDescription(m.getDescription());
setPreview(m.getPreview());
foundInList = true;
}
}
if (!foundInList) {
setOnlineState(State.OFFLINE);
}
}
State state = getOnlineState(true);
return state == ONLINE || state == GROUP || state == PRIVATE;