add:新增jellyfin搜刮及推送功能

This commit is contained in:
Yutousama 2022-07-11 17:09:38 +08:00
parent cf30e6db7c
commit b783224077

View File

@ -1,6 +1,8 @@
package com.yutou.nas.Controllers; package com.yutou.nas.Controllers;
import com.yutou.nas.interfaces.ObjectInterface;
import com.yutou.nas.utils.AppTools; import com.yutou.nas.utils.AppTools;
import com.yutou.nas.utils.Log;
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;
@ -14,7 +16,7 @@ public class JellyfinController {
public String addItem(String Name, String Date) { public String addItem(String Name, String Date) {
if (!StringUtils.isEmpty(Name) && !StringUtils.isEmpty(Date)) { if (!StringUtils.isEmpty(Name) && !StringUtils.isEmpty(Date)) {
QQBotManager.getInstance().sendMessage(734332887L, Date + " 新增:" + Name); QQBotManager.getInstance().sendMessage(734332887L, Date + " 新增:" + Name);
AppTools.exec("/public/servier/tinyMediaManager/tinyMediaManager tvshow --scrapeUnscraped", null, false, false); AppTools.exec("/public/servier/tinyMediaManager/tinyMediaManager tvshow --scrapeUnscraped", null, false, true);
} }
return "ok"; return "ok";
} }
@ -22,7 +24,13 @@ public class JellyfinController {
@ResponseBody @ResponseBody
@RequestMapping("/jellyfin/updateMeta") @RequestMapping("/jellyfin/updateMeta")
public String updateMeta() { public String updateMeta() {
AppTools.exec("/public/servier/tinyMediaManager/tinyMediaManager tvshow --scrapeUnscraped", null, false, false); AppTools.exec("/public/servier/tinyMediaManager/tinyMediaManager tvshow --scrapeUnscraped", new ObjectInterface() {
@Override
public void out(String data) {
super.out(data);
Log.i("jellyfin",data);
}
}, false, true);
return "ok"; return "ok";
} }
} }