|
@@ -49,9 +49,9 @@ public class GetPolyvAnalysisData extends BaseClass implements Runnable {
|
|
|
if (channelids.length > 20) {
|
|
|
int size = channelids.length / 20;
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
- livestatusMap.putAll(polyv.getLiveStatuses(Arrays.copyOfRange(channelids, i * 20, (i + 1) * 20 )));
|
|
|
+ livestatusMap.putAll(polyv.getLiveStatuses(Arrays.copyOfRange(channelids, i * 20, (i + 1) * 20)));
|
|
|
}
|
|
|
- livestatusMap.putAll(polyv.getLiveStatuses(Arrays.copyOfRange(channelids, size * 20, channelids.length )));
|
|
|
+ livestatusMap.putAll(polyv.getLiveStatuses(Arrays.copyOfRange(channelids, size * 20, channelids.length)));
|
|
|
} else {
|
|
|
livestatusMap = polyv.getLiveStatuses(channelids);
|
|
|
}
|
|
@@ -59,17 +59,19 @@ public class GetPolyvAnalysisData extends BaseClass implements Runnable {
|
|
|
ArrayList<String> sqllist = new ArrayList<>();
|
|
|
for (String channelid : livestatusMap.keySet()) {
|
|
|
String livestatus = livestatusMap.get(channelid);
|
|
|
- if (livestatus.equalsIgnoreCase("live")) {
|
|
|
- sqllist.add("update tlive set livestatus='" + livestatus + "',lastlivedate='" + getDate_Str() + "' ,channelcoverimageurl='" + polyv.getChannelImage(channelid, livestatus) + "' where channelid='" + channelid + "'");
|
|
|
- if (!livestatus.equals(map.get(channelid).get(0).getString("livestatus"))) {
|
|
|
- long tagentsid = map.get(channelid).get(0).getLong("tagentsid");
|
|
|
- String siteid = map.get(channelid).get(0).getString("siteid");
|
|
|
- createLiveMessage(siteid, tagentsid);
|
|
|
+ if (map.containsKey(channelid)) {
|
|
|
+ if (livestatus.equalsIgnoreCase("live")) {
|
|
|
+ sqllist.add("update tlive set livestatus='" + livestatus + "',lastlivedate='" + getDate_Str() + "' ,channelcoverimageurl='" + polyv.getChannelImage(channelid, livestatus) + "' where channelid='" + channelid + "'");
|
|
|
+ if (!livestatus.equals(map.get(channelid).get(0).getString("livestatus"))) {
|
|
|
+ long tagentsid = map.get(channelid).get(0).getLong("tagentsid");
|
|
|
+ String siteid = map.get(channelid).get(0).getString("siteid");
|
|
|
+ createLiveMessage(siteid, tagentsid);
|
|
|
+ }
|
|
|
+ } else if (livestatus.equalsIgnoreCase("waiting")) {
|
|
|
+ sqllist.add("update tlive set livestatus='" + livestatus + "',channelcoverimageurl='" + polyv.getChannelImage(channelid, livestatus) + "' where channelid='" + channelid + "'");
|
|
|
+ } else {
|
|
|
+ sqllist.add("update tlive set livestatus='" + livestatus + "' where channelid='" + channelid + "'");
|
|
|
}
|
|
|
- } else if (livestatus.equalsIgnoreCase("waiting")) {
|
|
|
- sqllist.add("update tlive set livestatus='" + livestatus + "',channelcoverimageurl='" + polyv.getChannelImage(channelid, livestatus) + "' where channelid='" + channelid + "'");
|
|
|
- } else {
|
|
|
- sqllist.add("update tlive set livestatus='" + livestatus + "' where channelid='" + channelid + "'");
|
|
|
}
|
|
|
}
|
|
|
dbConnect.runSqlUpdate(sqllist);
|