修复下载扫描未过滤开关的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) @Import(BTDownloadManager.class)
@SpringBootApplication @SpringBootApplication
public class NasApplication { 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) { public static void main(String[] args) {
SpringApplication.run(NasApplication.class, args); SpringApplication.run(NasApplication.class, args);
AppData.defaultMusicPath = (String) ConfigTools.load(ConfigTools.CONFIG, "musicDir"); AppData.defaultMusicPath = (String) ConfigTools.load(ConfigTools.CONFIG, "musicDir");

View File

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