This commit is contained in:
Yutousama 2022-11-04 18:13:29 +08:00
parent 8fa1f81ff9
commit a39d99eeb6
2 changed files with 21 additions and 28 deletions

View File

@ -60,14 +60,14 @@
<dependency> <dependency>
<groupId>redis.clients</groupId> <groupId>redis.clients</groupId>
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
<version>4.2.2</version> <version>4.3.1</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson --> <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency> <dependency>
<groupId>com.alibaba.fastjson2</groupId> <groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId> <artifactId>fastjson2</artifactId>
<version>2.0.2</version> <version>2.0.17</version>
</dependency> </dependency>
<!-- <dependency> <!-- <dependency>
<groupId>com.alibaba.fastjson2</groupId> <groupId>com.alibaba.fastjson2</groupId>

View File

@ -49,6 +49,13 @@ public class JellyfinController {
json.put("code",0); json.put("code",0);
}else{ }else{
File dir=new File("web"+File.separator+"apk"+File.separator+"jellyfin"+File.separator); File dir=new File("web"+File.separator+"apk"+File.separator+"jellyfin"+File.separator);
buildDownloadJson(json, appVersion, dir);
}
return json;
}
private void buildDownloadJson(JSONObject json, String appVersion, File dir) {
json.put("code",0); json.put("code",0);
if(dir.exists()){ if(dir.exists()){
for (File file : dir.listFiles()) { for (File file : dir.listFiles()) {
@ -62,10 +69,8 @@ public class JellyfinController {
} }
} }
} }
}
}
return json;
}
@ResponseBody @ResponseBody
@RequestMapping("/jellyfin/updateTvApp.do") @RequestMapping("/jellyfin/updateTvApp.do")
public JSONObject updateTvApp(String version){ public JSONObject updateTvApp(String version){
@ -75,19 +80,7 @@ public class JellyfinController {
json.put("code",0); json.put("code",0);
}else{ }else{
File dir=new File("web"+File.separator+"apk"+File.separator+"jellyfinTv"+File.separator); File dir=new File("web"+File.separator+"apk"+File.separator+"jellyfinTv"+File.separator);
json.put("code",0); buildDownloadJson(json, appVersion, dir);
if(dir.exists()){
for (File file : dir.listFiles()) {
if(file.getName().endsWith(".apk")){
json.put("code",1);
JSONObject data=new JSONObject();
data.put("version",appVersion);
data.put("url","http://nas.cnmglz.com:9999/apk"+file.getAbsolutePath().replace(new File("web"+File.separator+"apk"+File.separator).getAbsolutePath(),""));
json.put("data",data);
break;
}
}
}
} }
return json; return json;