forked from j62/ctbrec
Improve Showup online detection
This commit is contained in:
parent
e096e8555f
commit
c05785cd20
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue