新增对Jellyfin的搜刮(但未完成自动化)
This commit is contained in:
@@ -23,6 +23,7 @@ public class BTDownloadManager implements ApplicationContextAware {
|
||||
@Resource
|
||||
IBangumiService bangumiService;
|
||||
private static BTDownloadManager manager;
|
||||
private static final String DownloadHomePath="/media/yutou/disk_lvm/public/";
|
||||
|
||||
public static BTDownloadManager getInstance() {
|
||||
if (manager == null) {
|
||||
@@ -41,6 +42,11 @@ public class BTDownloadManager implements ApplicationContextAware {
|
||||
List<BangumiItem> list = bangumiService.getAllBangumi();
|
||||
AnimationData data = new AnimationData();
|
||||
Log.i("BT","启动BT检测,总数:"+list.size());
|
||||
File path=new File(DownloadHomePath);
|
||||
if(!path.exists()){
|
||||
Log.i("BT","下载目录已离线,取消扫描");
|
||||
return;
|
||||
}
|
||||
for (BangumiItem item : list) {
|
||||
if(item.getEnable()==0){
|
||||
continue;
|
||||
@@ -119,16 +125,18 @@ public class BTDownloadManager implements ApplicationContextAware {
|
||||
|
||||
public boolean download(String title, String url) {
|
||||
try {
|
||||
String exec = String.format("transmission-remote -n yutou:34864394 -w /media/yutou/4t/public/download/anim/%s -a \"%s\" "
|
||||
String exec = String.format("transmission-remote -n yutou:34864394 -w %sanim/%s -a \"%s\" "
|
||||
,DownloadHomePath
|
||||
, title
|
||||
, url
|
||||
);
|
||||
Log.i(exec);
|
||||
Runtime.getRuntime().exec(new String[]{"sh"
|
||||
Process process=Runtime.getRuntime().exec(new String[]{"sh"
|
||||
, "-c"
|
||||
, exec});
|
||||
process.exitValue();
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user