diff --git a/src/main/java/com/yutou/nas/NasApplication.java b/src/main/java/com/yutou/nas/NasApplication.java index cfc1865..979ebd5 100644 --- a/src/main/java/com/yutou/nas/NasApplication.java +++ b/src/main/java/com/yutou/nas/NasApplication.java @@ -12,7 +12,7 @@ import org.springframework.context.annotation.Import; @Import(BTDownloadManager.class) @SpringBootApplication public class NasApplication { - public static final String version="1.1.0"; + public static final String version="1.1.2"; public static void main(String[] args) { SpringApplication.run(NasApplication.class, args); AppData.defaultMusicPath = (String) ConfigTools.load(ConfigTools.CONFIG, "musicDir"); diff --git a/src/main/java/com/yutou/nas/mybatis/model/BangumiItem.java b/src/main/java/com/yutou/nas/mybatis/model/BangumiItem.java index a176858..e8c56e2 100644 --- a/src/main/java/com/yutou/nas/mybatis/model/BangumiItem.java +++ b/src/main/java/com/yutou/nas/mybatis/model/BangumiItem.java @@ -24,5 +24,7 @@ public class BangumiItem implements Serializable { */ private String titlekey; + private Integer enable; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/com/yutou/nas/mybatis/model/BangumiItemExample.java b/src/main/java/com/yutou/nas/mybatis/model/BangumiItemExample.java index 77bf9a0..60160f2 100644 --- a/src/main/java/com/yutou/nas/mybatis/model/BangumiItemExample.java +++ b/src/main/java/com/yutou/nas/mybatis/model/BangumiItemExample.java @@ -513,6 +513,66 @@ public class BangumiItemExample { addCriterion("titleKey not between", value1, value2, "titlekey"); return (Criteria) this; } + + public Criteria andEnableIsNull() { + addCriterion("`enable` is null"); + return (Criteria) this; + } + + public Criteria andEnableIsNotNull() { + addCriterion("`enable` is not null"); + return (Criteria) this; + } + + public Criteria andEnableEqualTo(Integer value) { + addCriterion("`enable` =", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotEqualTo(Integer value) { + addCriterion("`enable` <>", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThan(Integer value) { + addCriterion("`enable` >", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThanOrEqualTo(Integer value) { + addCriterion("`enable` >=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThan(Integer value) { + addCriterion("`enable` <", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThanOrEqualTo(Integer value) { + addCriterion("`enable` <=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableIn(List values) { + addCriterion("`enable` in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotIn(List values) { + addCriterion("`enable` not in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableBetween(Integer value1, Integer value2) { + addCriterion("`enable` between", value1, value2, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotBetween(Integer value1, Integer value2) { + addCriterion("`enable` not between", value1, value2, "enable"); + return (Criteria) this; + } } /** diff --git a/src/main/java/com/yutou/nas/utils/BTDownloadManager.java b/src/main/java/com/yutou/nas/utils/BTDownloadManager.java index 442dba8..b3fd71b 100644 --- a/src/main/java/com/yutou/nas/utils/BTDownloadManager.java +++ b/src/main/java/com/yutou/nas/utils/BTDownloadManager.java @@ -44,6 +44,9 @@ public class BTDownloadManager implements ApplicationContextAware { AnimationData data = new AnimationData(); Log.i("BT","启动BT检测,总数:"+list.size()); for (BangumiItem item : list) { + if(item.getEnable()==0){ + continue; + } item.setAuthor(data.nameToValue(item.getAuthor(), true) + ""); item.setCategories(data.nameToValue(item.getCategories(), false) + ""); String url = getRSSUrl(item); @@ -92,7 +95,11 @@ public class BTDownloadManager implements ApplicationContextAware { } else { onSend(null, item); } + }else{ + Log.i("BT","添加到下载器失败:"+item.getString("title")); } + }else{ + Log.i("BT","已下载过:"+item.getString("title")); } } }else{ diff --git a/src/main/java/com/yutou/nas/utils/QQBotManager.java b/src/main/java/com/yutou/nas/utils/QQBotManager.java index beea263..0223971 100644 --- a/src/main/java/com/yutou/nas/utils/QQBotManager.java +++ b/src/main/java/com/yutou/nas/utils/QQBotManager.java @@ -42,7 +42,7 @@ public class QQBotManager { private final static String QQ_AUDIO = "!语音"; private final static String QQ_AUDIO_OPEN_LAMP = "!开灯"; private final static String QQ_AUDIO_OPEN_AIR = "!开空调"; - private final static String QQ_BT_RELOAD = "!刷BT"; + private final static String QQ_BT_RELOAD = "!刷bt"; private final static String QQ_TOOLS_IDEA = "!idea"; private final static String QQ_TOOLS_IDEA_FILE = "!idea>"; } @@ -227,6 +227,7 @@ public class QQBotManager { private void myGroup(String msg) { StringBuilder builder; msg = msg.replace("!", "!").toLowerCase(); + Log.i("QQBot","command = "+msg); switch (msg) { case QQCommands.QQ_OPEN_PC: RedisTools.Consumer.system("openPC", null); diff --git a/src/main/resources/mappers/BangumiItemDao.xml b/src/main/resources/mappers/BangumiItemDao.xml index ea62a20..cb925f2 100644 --- a/src/main/resources/mappers/BangumiItemDao.xml +++ b/src/main/resources/mappers/BangumiItemDao.xml @@ -8,6 +8,7 @@ + @@ -68,7 +69,7 @@ - id, bid, categories, author, title, titleKey + id, bid, categories, author, title, titleKey, `enable` @@ -170,6 +179,9 @@ titleKey = #{record.titlekey,jdbcType=VARCHAR}, + + `enable` = #{record.enable,jdbcType=INTEGER}, + @@ -182,7 +194,8 @@ categories = #{record.categories,jdbcType=VARCHAR}, author = #{record.author,jdbcType=VARCHAR}, title = #{record.title,jdbcType=VARCHAR}, - titleKey = #{record.titlekey,jdbcType=VARCHAR} + titleKey = #{record.titlekey,jdbcType=VARCHAR}, + `enable` = #{record.enable,jdbcType=INTEGER} @@ -205,6 +218,9 @@ titleKey = #{titlekey,jdbcType=VARCHAR}, + + `enable` = #{enable,jdbcType=INTEGER}, + where id = #{id,jdbcType=INTEGER} @@ -214,7 +230,8 @@ categories = #{categories,jdbcType=VARCHAR}, author = #{author,jdbcType=VARCHAR}, title = #{title,jdbcType=VARCHAR}, - titleKey = #{titlekey,jdbcType=VARCHAR} + titleKey = #{titlekey,jdbcType=VARCHAR}, + `enable` = #{enable,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER} \ No newline at end of file