add:新增jellyfin搜刮及推送功能
This commit is contained in:
parent
e090e6375e
commit
cf30e6db7c
@ -0,0 +1,28 @@
|
|||||||
|
package com.yutou.nas.Controllers;
|
||||||
|
|
||||||
|
import com.yutou.nas.utils.AppTools;
|
||||||
|
import com.yutou.nas.utils.QQBotManager;
|
||||||
|
import com.yutou.nas.utils.StringUtils;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class JellyfinController {
|
||||||
|
@RequestMapping("/jellyfin/addItem")
|
||||||
|
@ResponseBody
|
||||||
|
public String addItem(String Name, String Date) {
|
||||||
|
if (!StringUtils.isEmpty(Name) && !StringUtils.isEmpty(Date)) {
|
||||||
|
QQBotManager.getInstance().sendMessage(734332887L, Date + " 新增:" + Name);
|
||||||
|
AppTools.exec("/public/servier/tinyMediaManager/tinyMediaManager tvshow --scrapeUnscraped", null, false, false);
|
||||||
|
}
|
||||||
|
return "ok";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/jellyfin/updateMeta")
|
||||||
|
public String updateMeta() {
|
||||||
|
AppTools.exec("/public/servier/tinyMediaManager/tinyMediaManager tvshow --scrapeUnscraped", null, false, false);
|
||||||
|
return "ok";
|
||||||
|
}
|
||||||
|
}
|
@ -38,6 +38,14 @@ public class QQBotManager {
|
|||||||
return HttpTools.http_post("http://192.168.31.88:802/qq/send.do", json.toString().getBytes(StandardCharsets.UTF_8), 1, header);
|
return HttpTools.http_post("http://192.168.31.88:802/qq/send.do", json.toString().getBytes(StandardCharsets.UTF_8), 1, header);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String sendMessage(long qq,String text) {
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("qq", qq);
|
||||||
|
json.put("message",text);
|
||||||
|
Map<String, String> header = new HashMap<>();
|
||||||
|
header.put("content-type", "application/json");
|
||||||
|
return HttpTools.http_post("http://192.168.31.88:802/qq/send.do", json.toString().getBytes(StandardCharsets.UTF_8), 1, header);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String sendMessage(String imageUrl, String message) {
|
public String sendMessage(String imageUrl, String message) {
|
||||||
|
Loading…
Reference in New Issue
Block a user