diff --git a/src/main/java/com/yutou/biliapi/databases/BiliLiveDatabase.java b/src/main/java/com/yutou/biliapi/databases/BiliLiveDatabase.java index 2ab2fb7..d563d7b 100644 --- a/src/main/java/com/yutou/biliapi/databases/BiliLiveDatabase.java +++ b/src/main/java/com/yutou/biliapi/databases/BiliLiveDatabase.java @@ -206,7 +206,7 @@ public class BiliLiveDatabase extends SQLiteManager { public List getDanmu(Long startTime, Long endTime, int page, int pageSize) { - List list=new ArrayList<>(); + List list = new ArrayList<>(); String query = "SELECT danmu AS text, fontSize, color, (sql_time - ?) AS `time`, " + "CASE WHEN model < 4 THEN 'scroll' " @@ -238,7 +238,7 @@ public class BiliLiveDatabase extends SQLiteManager { LiveWebDanmuBean.Danmu danmu = new LiveWebDanmuBean.Danmu(); danmu.setText(text); danmu.setFontSize(fontSize); - danmu.setColor(color); + danmu.setColor("#" + color); danmu.setTime(time); danmu.setBarrageType(model); list.add(danmu); diff --git a/src/main/java/com/yutou/bilibili/services/LiveDatabasesService.java b/src/main/java/com/yutou/bilibili/services/LiveDatabasesService.java index 2498834..86d2f6c 100644 --- a/src/main/java/com/yutou/bilibili/services/LiveDatabasesService.java +++ b/src/main/java/com/yutou/bilibili/services/LiveDatabasesService.java @@ -19,7 +19,7 @@ import java.util.concurrent.TimeUnit; public class LiveDatabasesService { private static final Cache liveDatabases = CacheBuilder.newBuilder() .maximumSize(1000) - .expireAfterAccess(30, TimeUnit.MINUTES) + .expireAfterAccess(2, TimeUnit.MINUTES) .removalListener(it -> { if (it.wasEvicted()) { if (it.getValue() != null) { @@ -34,7 +34,7 @@ public class LiveDatabasesService { configDatabase = new BiliLiveConfigDatabase(); } public String getCacheInfo() { - return "总数:"+liveDatabases.size()+","+ Arrays.toString(liveDatabases.asMap().keySet().toArray()); + return "总数:"+liveDatabases.size()+","+ Arrays.toString(liveDatabases.asMap().keySet().toArray())+","+ Arrays.toString(liveDatabases.asMap().values().toArray()); } public BiliLiveDatabase getLiveDatabase(String roomId) {