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>
</div>
<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> -->
{{= item.title}}<br>
<p>开播时长:{{= item.liveTime}}</p>

View File

@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLDecoder;
@ -52,7 +53,13 @@ public class VideoFileController {
url = URLDecoder.decode(url, StandardCharsets.UTF_8);
String encode = AppTools.getMD5(url);
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);
}
if (!img.getParentFile().exists()) {

View File

@ -53,8 +53,6 @@ public abstract class SQLiteManager {
type = BuildSqlItem.TYPE_BOOLEAN;
} else if (field.getType() == ISqlDatabaseBean.class) {
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)));
}
@ -135,14 +133,16 @@ public abstract class SQLiteManager {
if ("id".equals(key)) {
continue;
}
if("sql_time".equals(key)){
statement.setLong(i++,json.getDate(key).getTime());
continue;
}
if (json.get(key) instanceof String) {
statement.setString(i++, json.get(key).toString());
} else if (json.get(key) instanceof Integer) {
statement.setInt(i++, json.getInteger(key));
} else if (json.get(key) instanceof Long) {
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) {
statement.setBoolean(i++, json.getBoolean(key));
} else if(json.get(key) instanceof Date){
@ -204,8 +204,8 @@ public abstract class SQLiteManager {
}
// 设置 sql_time 的值
String id = String.valueOf(t.getSql_time());
statement.setString(i, id);
long id = t.getSql_time().getTime();
statement.setLong(i, id);
statement.executeUpdate();
statement.close();

View File

@ -67,7 +67,6 @@ public class HttpDownloadUtils {
}
public static File downloadSync(Builder builder) {
createHttpClient(builder);
try {
Response response = createHttpClient(builder).execute();
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) {
try {
FileUtils.deleteDirectory(new File(outputPath));
} catch (IOException e) {
throw new RuntimeException(e);
} catch (IOException ignored) {
}
new File(outputPath).mkdirs();
FFmpegUtils ffmpeg = new FFmpegUtils();