fix 更新配置失效问题

This commit is contained in:
Yutousama 2024-11-24 05:36:30 +08:00
parent 41d3dec536
commit 71d090872d
5 changed files with 17 additions and 11 deletions

View File

@ -59,7 +59,7 @@
</span> </span>
</div> </div>
<div class="layui-card-body"> <div class="layui-card-body">
<img src="#" onerror="showTmpImage('{{= item.cover}}',this)" onclick="toLive('{{= item.roomId}}')" style="width: 100%; height: 175px; object-fit: cover;"/><br> <img src="#" onerror="showTmpImage('{{= item.cover}}',this)" onclick="toLive('{{= item.roomId}}')" style="width: 100%; height: 100%; object-fit: cover;"/><br>
<!-- <img src="#" onerror="showImage('{{= item.cover}}',this)" onclick="toLive('{{= item.roomId}}')" style="width: 100%; height: 100%;"/><br> --> <!-- <img src="#" onerror="showImage('{{= item.cover}}',this)" onclick="toLive('{{= item.roomId}}')" style="width: 100%; height: 100%;"/><br> -->
{{= item.title}}<br> {{= item.title}}<br>
<p>开播时长:{{= item.liveTime}}</p> <p>开播时长:{{= item.liveTime}}</p>

View File

@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;
import java.net.URLDecoder; import java.net.URLDecoder;
@ -52,7 +53,13 @@ public class VideoFileController {
url = URLDecoder.decode(url, StandardCharsets.UTF_8); url = URLDecoder.decode(url, StandardCharsets.UTF_8);
String encode = AppTools.getMD5(url); String encode = AppTools.getMD5(url);
File img = new File("cache" + File.separator + "image" + File.separator + encode); File img = new File("cache" + File.separator + "image" + File.separator + encode);
if (img.exists()) { int length;
try {
length = new URL(url).openConnection().getContentLength();
} catch (IOException e) {
throw new RuntimeException(e);
}
if (img.exists()&&length==img.length()) {
return Tools.getFile(img); return Tools.getFile(img);
} }
if (!img.getParentFile().exists()) { if (!img.getParentFile().exists()) {

View File

@ -53,8 +53,6 @@ public abstract class SQLiteManager {
type = BuildSqlItem.TYPE_BOOLEAN; type = BuildSqlItem.TYPE_BOOLEAN;
} else if (field.getType() == ISqlDatabaseBean.class) { } else if (field.getType() == ISqlDatabaseBean.class) {
type = BuildSqlItem.TYPE_TEXT; type = BuildSqlItem.TYPE_TEXT;
} else if (field.getType() == String.class) {
type = BuildSqlItem.TYPE_INT;
} }
items.add(BuildSqlItem.create().setName(name).setType(type).setNull(!"id".equals(name)).setKey("id".equals(name))); items.add(BuildSqlItem.create().setName(name).setType(type).setNull(!"id".equals(name)).setKey("id".equals(name)));
} }
@ -135,14 +133,16 @@ public abstract class SQLiteManager {
if ("id".equals(key)) { if ("id".equals(key)) {
continue; continue;
} }
if("sql_time".equals(key)){
statement.setLong(i++,json.getDate(key).getTime());
continue;
}
if (json.get(key) instanceof String) { if (json.get(key) instanceof String) {
statement.setString(i++, json.get(key).toString()); statement.setString(i++, json.get(key).toString());
} else if (json.get(key) instanceof Integer) { } else if (json.get(key) instanceof Integer) {
statement.setInt(i++, json.getInteger(key)); statement.setInt(i++, json.getInteger(key));
} else if (json.get(key) instanceof Long) { } else if (json.get(key) instanceof Long) {
statement.setLong(i++, json.getLong(key)); statement.setLong(i++, json.getLong(key));
} else if (json.get(key) instanceof String) {
statement.setObject(i++, json.get(key));
} else if (json.get(key) instanceof Boolean) { } else if (json.get(key) instanceof Boolean) {
statement.setBoolean(i++, json.getBoolean(key)); statement.setBoolean(i++, json.getBoolean(key));
} else if(json.get(key) instanceof Date){ } else if(json.get(key) instanceof Date){
@ -204,8 +204,8 @@ public abstract class SQLiteManager {
} }
// 设置 sql_time 的值 // 设置 sql_time 的值
String id = String.valueOf(t.getSql_time()); long id = t.getSql_time().getTime();
statement.setString(i, id); statement.setLong(i, id);
statement.executeUpdate(); statement.executeUpdate();
statement.close(); statement.close();

View File

@ -67,7 +67,6 @@ public class HttpDownloadUtils {
} }
public static File downloadSync(Builder builder) { public static File downloadSync(Builder builder) {
createHttpClient(builder);
try { try {
Response response = createHttpClient(builder).execute(); Response response = createHttpClient(builder).execute();
InputStream inputStream = Objects.requireNonNull(response.body()).byteStream(); InputStream inputStream = Objects.requireNonNull(response.body()).byteStream();

View File

@ -72,8 +72,8 @@ public class FFmpegUtils extends AbsVideoRecord {
public static FFmpegUtils segment(String videoId, String ffmpegPath, File video, String outputPath) { public static FFmpegUtils segment(String videoId, String ffmpegPath, File video, String outputPath) {
try { try {
FileUtils.deleteDirectory(new File(outputPath)); FileUtils.deleteDirectory(new File(outputPath));
} catch (IOException e) { } catch (IOException ignored) {
throw new RuntimeException(e);
} }
new File(outputPath).mkdirs(); new File(outputPath).mkdirs();
FFmpegUtils ffmpeg = new FFmpegUtils(); FFmpegUtils ffmpeg = new FFmpegUtils();