Skip to content

Commit

Permalink
修复添加订阅时未启用也会进行下载的问题
Browse files Browse the repository at this point in the history
优化bgm自动点格子
  • Loading branch information
wushuo894 committed Oct 7, 2024
1 parent e6203b0 commit 84706e5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
4 changes: 3 additions & 1 deletion UPDATE.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
可在添加时检索 Bangumi 信息
修复添加订阅时未启用也会进行下载的问题

优化bgm自动点格子
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ani.rss</groupId>
<artifactId>ani-rss</artifactId>
<version>1.1.98</version>
<version>1.1.99</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand Down
13 changes: 8 additions & 5 deletions src/main/java/ani/rss/action/AniAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,14 @@ private void post() {

AniUtil.ANI_LIST.add(ani);
AniUtil.sync();
ThreadUtil.execute(() -> {
if (TorrentUtil.login()) {
TorrentUtil.downloadAni(ani);
}
});
Boolean enable = ani.getEnable();
if (enable) {
ThreadUtil.execute(() -> {
if (TorrentUtil.login()) {
TorrentUtil.downloadAni(ani);
}
});
}
resultSuccessMsg("添加订阅成功");
log.info("添加订阅 {} {} {}", ani.getTitle(), ani.getUrl(), ani.getId());
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/ani/rss/action/WebHookAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ public void doAction(HttpServerRequest request, HttpServerResponse response) thr
List<Ani> anis = ObjectUtil.clone(AniUtil.ANI_LIST);
Optional<String> first = anis.stream()
.filter(ani -> {
String title = ani.getTitle();
Integer season = ani.getSeason();
if (title.equals(seriesName) && s == season) {
return true;
}

List<File> downloadPath = TorrentUtil.getDownloadPath(ani);
for (File file : downloadPath) {
if (!file.exists()) {
Expand Down

0 comments on commit 84706e5

Please sign in to comment.