update:修复bgmId为空时的异常

This commit is contained in:
Yutousama 2022-07-10 17:10:28 +08:00
parent 6b8932c86f
commit 25730638a3

View File

@ -71,10 +71,13 @@ public class BangumiServiceImpl implements BangumiService {
example.createCriteria().andBidEqualTo(type);
List<BangumiItem> items = itemDao.selectByExample(example);
for (BangumiItem item : items) {
if(item.getEnable()==0){
if(item.getEnable()==0||item.getBgmid()==0){
continue;
}
JSONObject bangumi=BangumiTools.getBangumiInfoSmall(item.getBgmid());
if(bangumi.getInteger("code")==404){
continue;
}
int day=Tools.getWeekDay();
if (day == 0) {
day = 7;