update:触发搜刮器后更新jellyfin元素
This commit is contained in:
parent
1045e761c9
commit
ca06eed516
@ -1,6 +1,7 @@
|
|||||||
package com.yutou.nas.Controllers;
|
package com.yutou.nas.Controllers;
|
||||||
|
|
||||||
import com.yutou.nas.utils.AppTools;
|
import com.yutou.nas.utils.AppTools;
|
||||||
|
import com.yutou.nas.utils.JellyfinAPIManager;
|
||||||
import com.yutou.nas.utils.QQBotManager;
|
import com.yutou.nas.utils.QQBotManager;
|
||||||
import com.yutou.nas.utils.StringUtils;
|
import com.yutou.nas.utils.StringUtils;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
@ -15,6 +16,7 @@ public class JellyfinController {
|
|||||||
if (!StringUtils.isEmpty(Name) && !StringUtils.isEmpty(Date)) {
|
if (!StringUtils.isEmpty(Name) && !StringUtils.isEmpty(Date)) {
|
||||||
QQBotManager.getInstance().sendMessage(734332887L, " 新增:" + Name);
|
QQBotManager.getInstance().sendMessage(734332887L, " 新增:" + Name);
|
||||||
AppTools.exec("/home/yutou/public/servier/tinyMediaManager/tinyMediaManager tvshow -u --scrapeUnscraped", null, false, true);
|
AppTools.exec("/home/yutou/public/servier/tinyMediaManager/tinyMediaManager tvshow -u --scrapeUnscraped", null, false, true);
|
||||||
|
new JellyfinAPIManager().refresh();
|
||||||
}
|
}
|
||||||
return "ok";
|
return "ok";
|
||||||
}
|
}
|
||||||
@ -23,6 +25,7 @@ public class JellyfinController {
|
|||||||
@RequestMapping("/jellyfin/updateMeta")
|
@RequestMapping("/jellyfin/updateMeta")
|
||||||
public String updateMeta() {
|
public String updateMeta() {
|
||||||
AppTools.exec("/home/yutou/public/servier/tinyMediaManager/tinyMediaManager tvshow -u --scrapeUnscraped", null, false, true);
|
AppTools.exec("/home/yutou/public/servier/tinyMediaManager/tinyMediaManager tvshow -u --scrapeUnscraped", null, false, true);
|
||||||
|
new JellyfinAPIManager().refresh();
|
||||||
return "ok";
|
return "ok";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,6 +64,9 @@ public class HttpTools {
|
|||||||
connection.addRequestProperty(key, headers.get(key));
|
connection.addRequestProperty(key, headers.get(key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(body==null){
|
||||||
|
body="".getBytes();
|
||||||
|
}
|
||||||
connection.setDoOutput(true);
|
connection.setDoOutput(true);
|
||||||
connection.setDoInput(true);
|
connection.setDoInput(true);
|
||||||
connection.addRequestProperty("User-Agent", getUa());
|
connection.addRequestProperty("User-Agent", getUa());
|
||||||
|
@ -279,6 +279,11 @@ public class JellyfinAPIManager {
|
|||||||
}
|
}
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
public void refresh(){
|
||||||
|
String url="http://192.168.31.88:8096/Items/28e774baf8f2fd279e7d58da9890a7d2/Refresh?Recursive=true&ImageRefreshMode=FullRefresh&MetadataRefreshMode=FullRefresh&ReplaceAllImages=false&ReplaceAllMetadata=true";
|
||||||
|
String tmp=HttpTools.http_post(url,null,1,getHeader());
|
||||||
|
System.out.println(tmp);
|
||||||
|
}
|
||||||
|
|
||||||
public void init(File path,String id) {
|
public void init(File path,String id) {
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user