新增设置动画meta接口
This commit is contained in:
@@ -278,73 +278,60 @@ public class JellyfinAPIManager {
|
||||
return array;
|
||||
}
|
||||
|
||||
public void init(File path) {
|
||||
if (path.isDirectory()) {
|
||||
File file = new File(path.getAbsolutePath() + File.separator + "info.ini");
|
||||
if (!file.exists()) {
|
||||
try {
|
||||
file.createNewFile();
|
||||
System.out.println("创建:" + file.getAbsolutePath());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
String id = ConfigTools.loadIni(file, "id");
|
||||
if (id != null) {
|
||||
for (LibsItem item : mediaItem) {
|
||||
List<LibsItem> _temp = getLibsItems(item.getId());
|
||||
if (_temp.size() == 1) {
|
||||
if (item.getInfo().getPath().contains(path.getPath())) {
|
||||
System.out.println(item.getName() + " " + id);
|
||||
new JellyfinAPIManager().saveJellyfinMetaData(BangumiTools.getBangumiInfo(Integer.parseInt(id)), item);
|
||||
public void init(File path,String id) {
|
||||
if (id != null) {
|
||||
for (LibsItem item : mediaItem) {
|
||||
List<LibsItem> _temp = getLibsItems(item.getId());
|
||||
if (_temp.size() == 1) {
|
||||
if (item.getInfo().getPath().contains(path.getPath())) {
|
||||
System.out.println(item.getName() + " " + id);
|
||||
new JellyfinAPIManager().saveJellyfinMetaData(BangumiTools.getBangumiInfo(Integer.parseInt(id)), item);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
System.out.println(item.getName() + " > " + _temp.size());
|
||||
for (LibsItem libsItem : _temp) {
|
||||
ItemInfo info = getInfo(libsItem.getId());
|
||||
if (info.getPath() != null) {
|
||||
if (info.getPath().contains(path.getPath())) {
|
||||
System.out.println("list > " + item.getName() + " " + id);
|
||||
new JellyfinAPIManager().saveJellyfinMetaData(BangumiTools.getBangumiInfo(Integer.parseInt(id)), libsItem);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
System.out.println(item.getName() + " > " + _temp.size());
|
||||
for (LibsItem libsItem : _temp) {
|
||||
ItemInfo info = getInfo(libsItem.getId());
|
||||
if (info.getPath() != null) {
|
||||
if (info.getPath().contains(path.getPath())) {
|
||||
System.out.println("list > " + item.getName() + " " + id);
|
||||
new JellyfinAPIManager().saveJellyfinMetaData(BangumiTools.getBangumiInfo(Integer.parseInt(id)), libsItem);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
String ep_Path = getPathForEpisode(info.getParentID(), info.getId());
|
||||
if (ep_Path != null && ep_Path.contains(path.getPath())) {
|
||||
System.out.println("list > " + item.getName() + " " + id);
|
||||
new JellyfinAPIManager().saveJellyfinMetaData(BangumiTools.getBangumiInfo(Integer.parseInt(id)), libsItem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
String ep_Path = getPathForEpisode(info.getParentID(), info.getId());
|
||||
if (ep_Path != null && ep_Path.contains(path.getPath())) {
|
||||
System.out.println("list > " + item.getName() + " " + id);
|
||||
new JellyfinAPIManager().saveJellyfinMetaData(BangumiTools.getBangumiInfo(Integer.parseInt(id)), libsItem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (item.getInfo().getPath().contains(path.getPath())) {
|
||||
System.out.println(item.getName() + " " + id);
|
||||
new JellyfinAPIManager().saveJellyfinMetaData(BangumiTools.getBangumiInfo(Integer.parseInt(id)), item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.getInfo().getPath().contains(path.getPath())) {
|
||||
System.out.println(item.getName() + " " + id);
|
||||
new JellyfinAPIManager().saveJellyfinMetaData(BangumiTools.getBangumiInfo(Integer.parseInt(id)), item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (File file : path.listFiles()) {
|
||||
/*for (File file : path.listFiles()) {
|
||||
if (file.isDirectory()) {
|
||||
// System.out.println("搜索目录:"+file.getAbsolutePath());
|
||||
init(file);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
public static String mainPath = "Z:\\download\\anim\\";
|
||||
|
||||
public static void main(String[] args) {
|
||||
File file = new File("Z:\\download\\anim\\Bangdream☆pico");
|
||||
File file = new File("Z:\\download\\anim\\白沙的水族馆");
|
||||
//new JellyfinAPIManager().search(file.getName(), file);
|
||||
JellyfinAPIManager manager = new JellyfinAPIManager();
|
||||
// manager.init(file);
|
||||
JSONArray search = manager.getAnimPaths();
|
||||
System.out.println(search);
|
||||
manager.init(file,"325281");
|
||||
//JSONArray search = manager.getAnimPaths();
|
||||
//System.out.println(search);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user