From 006fb8c836a40cb1a694b8fb58ebeb52fc8c907f Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Tue, 28 Dec 2021 14:31:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9F=B3=E4=B9=90=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=8E=B7=E5=8F=96=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- src/main/java/com/yutou/nas/NasApplication.java | 2 +- .../com/yutou/nas/Services/impl/MusicToolsServiceImpl.java | 3 +++ src/main/java/com/yutou/nas/utils/BTDownloadManager.java | 6 +++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 33bca14..f8bd250 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ net.mamoe mirai-core-jvm - 2.7.0 + 2.7.1 org.jetbrains.kotlinx diff --git a/src/main/java/com/yutou/nas/NasApplication.java b/src/main/java/com/yutou/nas/NasApplication.java index 2df8f55..56761f4 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.2.3"; + public static final String version="1.2.4"; 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/Services/impl/MusicToolsServiceImpl.java b/src/main/java/com/yutou/nas/Services/impl/MusicToolsServiceImpl.java index 5f11ff1..54f3b88 100644 --- a/src/main/java/com/yutou/nas/Services/impl/MusicToolsServiceImpl.java +++ b/src/main/java/com/yutou/nas/Services/impl/MusicToolsServiceImpl.java @@ -114,6 +114,9 @@ public class MusicToolsServiceImpl implements IMusicToolsService { MusicDataExample example = new MusicDataExample(); String replacement = "windows".equals(ConfigTools.load(ConfigTools.CONFIG, "os")) ? "\\\\" : "/"; String tmpPath = path; + if(StringUtils.isEmpty(path)){ + tmpPath=AppData.defaultMusicPath; + } if (isDir) { example.createCriteria().andFileLike(tmpPath.replace(File.separator, replacement) + "%"); main = musicDataDao.selectByExample(example); diff --git a/src/main/java/com/yutou/nas/utils/BTDownloadManager.java b/src/main/java/com/yutou/nas/utils/BTDownloadManager.java index 57d1457..8f71a2a 100644 --- a/src/main/java/com/yutou/nas/utils/BTDownloadManager.java +++ b/src/main/java/com/yutou/nas/utils/BTDownloadManager.java @@ -66,11 +66,11 @@ public class BTDownloadManager implements ApplicationContextAware { } } private String getDmhyUrl(BangumiItem item){ - String dmhyUrl = "http://share.dmhy.org/topics/rss/page/1/rss.xml?keyword=%s%s%s&order=date-desc"; + String dmhyUrl = "http://share.dmhy.org/topics/rss/page/1/rss.xml?keyword=%s%s&order=date-desc"; dmhyUrl = String.format(dmhyUrl, item.getTitlekey().replace(" ", "+"), - "-1".equals(item.getCategories()) ? "" : String.format("&sort_id=%s", item.getCategories()), - "-1".equals(item.getAuthor()) ? "" : String.format("&team_id=%s", item.getAuthor())); + "-1".equals(item.getCategories()) ? "" : String.format("&sort_id=%s", item.getCategories()) + ); return dmhyUrl; } private String getRSSUrl(BangumiItem item) {