修复Jellyfin异常问题

This commit is contained in:
2022-05-04 10:58:17 +08:00
parent 51c15f4a34
commit 2f1ba2acb9
5 changed files with 58 additions and 30 deletions

View File

@@ -44,7 +44,7 @@ public class JellyfinAPIManager {
public ItemInfo getInfo(String id) {
String http = HttpTools.https_get("http://192.168.31.88:8096/Users/"+userId+"/Items/" + id, getHeader());
return JSON.parseObject(http, ItemInfo.class);
return JSON.parseObject(http).toJavaObject(ItemInfo.class);
}
public List<LibsItem> getAllItem() {
@@ -52,7 +52,7 @@ public class JellyfinAPIManager {
JSONObject json = JSON.parseObject(http);
JSONArray items = json.getJSONArray("Items");
List<LibsItem> list = JSON.parseArray(items.toJSONString(), LibsItem.class);
List<LibsItem> list =items.toJavaList(LibsItem.class);
for (LibsItem item : list) {
item.setInfo(getInfo(item.getId()));
}
@@ -63,7 +63,7 @@ public class JellyfinAPIManager {
String httpText = HttpTools.https_get("http://192.168.31.88:8096/Users/"+userId+"/Items?ParentId=" + id, getHeader());
JSONObject json = JSON.parseObject(httpText);
JSONArray items = json.getJSONArray("Items");
return JSON.parseArray(items.toJSONString(), LibsItem.class);
return items.toJavaList(LibsItem.class);
}
public JSONObject getItemShows(String id) {
@@ -333,8 +333,8 @@ public class JellyfinAPIManager {
File file = new File("Z:\\download\\anim\\白沙的水族馆");
//new JellyfinAPIManager().search(file.getName(), file);
JellyfinAPIManager manager = new JellyfinAPIManager();
manager.init(file,"325281");
//JSONArray search = manager.getAnimPaths();
//System.out.println(search);
// manager.init(file,"325281");
JSONArray search = manager.getAnimPaths();
System.out.println(search);
}
}