fix bugs
This commit is contained in:
@@ -69,6 +69,11 @@ public class UpInfoController {
|
||||
return json;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/upinfo/update.do")
|
||||
public JSONObject updateV1(BilibiliUpInfo upData) {
|
||||
return update(upData);
|
||||
}
|
||||
@ResponseBody
|
||||
@RequestMapping("/upinfo/set/update.do")
|
||||
public JSONObject update(BilibiliUpInfo upData) {
|
||||
@@ -132,6 +137,9 @@ public class UpInfoController {
|
||||
JSONObject infoData = infoByUid.getJSONObject("data");
|
||||
for (BilibiliUpInfo up : list) {
|
||||
JSONObject user = infoData.getJSONObject(up.getMid() + "");
|
||||
if(user==null){
|
||||
continue;
|
||||
}
|
||||
up.setLive(user.getInteger("live_status"));
|
||||
if (up.checkLiveStatus() == 1) {
|
||||
online++;
|
||||
|
||||
@@ -193,8 +193,12 @@ public class Live implements ApplicationContextAware {
|
||||
Log.i(roomId + " 断开连接,重连...");
|
||||
try {
|
||||
init = true;
|
||||
heartBeattimer.cancel();
|
||||
client.close();
|
||||
if(heartBeattimer!=null) {
|
||||
heartBeattimer.cancel();
|
||||
}
|
||||
if(client!=null) {
|
||||
client.close();
|
||||
}
|
||||
start();
|
||||
} catch (Exception e) {
|
||||
Log.e(e);
|
||||
|
||||
@@ -350,7 +350,7 @@ public class LiveUtils {
|
||||
}
|
||||
|
||||
public static long getMid(int roomId) {
|
||||
JSONObject http_get = http_get("http://api.live.bilibili.com/room/v1/Room/room_init?id=" + roomId);
|
||||
JSONObject http_get = http_get("https://api.live.bilibili.com/room/v1/Room/room_init?id=" + roomId);
|
||||
if (http_get == null) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user