Files
nas-service/src/main/java/com/yutou/nas/Services/impl/BangumiServiceImpl.java
Yutousama 584779cc13 fix:修复动漫花园订阅地址非https的问题
update:手动rss下载,同时跳过下一次自动订阅下载
2022-07-18 12:48:29 +08:00

38 lines
1.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.yutou.nas.Services.impl;
import com.yutou.nas.Services.IBangumiService;
import com.yutou.nas.mybatis.dao.BangumiItemDao;
import com.yutou.nas.mybatis.model.BangumiItem;
import com.yutou.nas.mybatis.model.BangumiItemExample;
import com.yutou.nas.utils.BTDownloadManager;
import com.yutou.nas.utils.Log;
import com.yutou.nas.utils.RedisTools;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("BangumiService")
public class BangumiServiceImpl implements IBangumiService {
@Resource
BangumiItemDao itemDao;
@Override
public List<BangumiItem> getAllBangumi() {
BangumiItemExample example=new BangumiItemExample();
example.createCriteria().andEnableEqualTo(1);
return itemDao.selectByExample(example);
}
@Override
public void download(int id,boolean isDownloadNext, String url) {
BangumiItem item = itemDao.selectByPrimaryKey(id);
if(item!=null){
BTDownloadManager.download(item.getTitle(),url);
if(!isDownloadNext){
Log.i("跳过下载","确定跳过:"+item.getTitle()+"的下载id = "+item.getId());
RedisTools.set(item.getId()+"","next");
}
}
}
}