From b5c85409cfd954a869b96626b3c8ef5d2abca768 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Sat, 30 Nov 2024 17:38:38 +0800 Subject: [PATCH] =?UTF-8?q?fix=E5=AD=97=E5=B9=95=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E4=B8=8D=E5=AF=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yutou/biliapi/databases/BiliLiveDatabase.java | 4 ++-- .../com/yutou/bilibili/services/LiveDatabasesService.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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) {