update
This commit is contained in:
@@ -49,23 +49,28 @@ public class JellyfinController {
|
||||
json.put("code",0);
|
||||
}else{
|
||||
File dir=new File("web"+File.separator+"apk"+File.separator+"jellyfin"+File.separator);
|
||||
json.put("code",0);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
buildDownloadJson(json, appVersion, dir);
|
||||
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
private void buildDownloadJson(JSONObject json, String appVersion, File dir) {
|
||||
json.put("code",0);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/jellyfin/updateTvApp.do")
|
||||
public JSONObject updateTvApp(String version){
|
||||
@@ -75,19 +80,7 @@ public class JellyfinController {
|
||||
json.put("code",0);
|
||||
}else{
|
||||
File dir=new File("web"+File.separator+"apk"+File.separator+"jellyfinTv"+File.separator);
|
||||
json.put("code",0);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
buildDownloadJson(json, appVersion, dir);
|
||||
|
||||
}
|
||||
return json;
|
||||
|
||||
Reference in New Issue
Block a user