fix字幕颜色不对问题

This commit is contained in:
zlzw 2024-11-30 17:38:38 +08:00
parent 23861a897f
commit b5c85409cf
2 changed files with 4 additions and 4 deletions

View File

@ -206,7 +206,7 @@ public class BiliLiveDatabase extends SQLiteManager {
public List<LiveWebDanmuBean.Danmu> getDanmu(Long startTime, Long endTime, int page, int pageSize) { public List<LiveWebDanmuBean.Danmu> getDanmu(Long startTime, Long endTime, int page, int pageSize) {
List<LiveWebDanmuBean.Danmu> list=new ArrayList<>(); List<LiveWebDanmuBean.Danmu> list = new ArrayList<>();
String query = "SELECT danmu AS text, fontSize, color, (sql_time - ?) AS `time`, " String query = "SELECT danmu AS text, fontSize, color, (sql_time - ?) AS `time`, "
+ "CASE WHEN model < 4 THEN 'scroll' " + "CASE WHEN model < 4 THEN 'scroll' "
@ -238,7 +238,7 @@ public class BiliLiveDatabase extends SQLiteManager {
LiveWebDanmuBean.Danmu danmu = new LiveWebDanmuBean.Danmu(); LiveWebDanmuBean.Danmu danmu = new LiveWebDanmuBean.Danmu();
danmu.setText(text); danmu.setText(text);
danmu.setFontSize(fontSize); danmu.setFontSize(fontSize);
danmu.setColor(color); danmu.setColor("#" + color);
danmu.setTime(time); danmu.setTime(time);
danmu.setBarrageType(model); danmu.setBarrageType(model);
list.add(danmu); list.add(danmu);

View File

@ -19,7 +19,7 @@ import java.util.concurrent.TimeUnit;
public class LiveDatabasesService { public class LiveDatabasesService {
private static final Cache<String, BiliLiveDatabase> liveDatabases = CacheBuilder.newBuilder() private static final Cache<String, BiliLiveDatabase> liveDatabases = CacheBuilder.newBuilder()
.maximumSize(1000) .maximumSize(1000)
.expireAfterAccess(30, TimeUnit.MINUTES) .expireAfterAccess(2, TimeUnit.MINUTES)
.removalListener(it -> { .removalListener(it -> {
if (it.wasEvicted()) { if (it.wasEvicted()) {
if (it.getValue() != null) { if (it.getValue() != null) {
@ -34,7 +34,7 @@ public class LiveDatabasesService {
configDatabase = new BiliLiveConfigDatabase(); configDatabase = new BiliLiveConfigDatabase();
} }
public String getCacheInfo() { 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) { public BiliLiveDatabase getLiveDatabase(String roomId) {