修复下载扫描未过滤开关的bug

This commit is contained in:
Yutousama 2022-04-07 16:23:28 +08:00
parent 9dc132bcae
commit ed97daa089
3 changed files with 9 additions and 2 deletions

View File

@ -12,7 +12,7 @@ import org.springframework.context.annotation.Import;
@Import(BTDownloadManager.class)
@SpringBootApplication
public class NasApplication {
public static final String version="1.2.10.2";
public static final String version="1.2.11";
public static void main(String[] args) {
SpringApplication.run(NasApplication.class, args);
AppData.defaultMusicPath = (String) ConfigTools.load(ConfigTools.CONFIG, "musicDir");

View File

@ -15,6 +15,8 @@ public class BangumiServiceImpl implements IBangumiService {
BangumiItemDao itemDao;
@Override
public List<BangumiItem> getAllBangumi() {
return itemDao.selectByExample(new BangumiItemExample());
BangumiItemExample example=new BangumiItemExample();
example.createCriteria().andEnableEqualTo(1);
return itemDao.selectByExample(example);
}
}

View File

@ -46,6 +46,9 @@ public class BTDownloadManager implements ApplicationContextAware {
List<BangumiItem> list = bangumiService.getAllBangumi();
AnimationData data = new AnimationData();
Log.i("BT","启动BT检测总数:"+list.size());
for (BangumiItem item : list) {
System.out.println("item.getTitle() = " + item.getTitle());
}
File path=new File(DownloadHomePath);
if(!path.exists()){
Log.i("BT","下载目录已离线,取消扫描");
@ -127,6 +130,8 @@ public class BTDownloadManager implements ApplicationContextAware {
}
public boolean download(String title, String url) {
if(true)
return false;
try {
String exec = String.format("transmission-remote -n yutou:34864394 -w \"%sanim/%s\" -a \"%s\" "
,DownloadHomePath