Skip to content

Commit

Permalink
修复mikan出现问题后无法下载种子导致一直发送通知的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wushuo894 committed Dec 2, 2024
1 parent 536d002 commit 462b74c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion UPDATE.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
现在支持手动设置GC时间
修复mikan出现问题后无法下载种子导致一直发送通知的问题
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.204</version>
<version>1.1.205</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/ani/rss/util/TorrentUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.text.StrFormatter;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.*;
Expand Down Expand Up @@ -183,7 +184,9 @@ public static synchronized void downloadAni(Ani ani) {
File saveTorrent = saveTorrent(ani, item);
List<File> downloadPathList = getDownloadPath(ani);

deleteBackRss(ani, item);
if (saveTorrent.exists()) {
deleteBackRss(ani, item);
}

String savePath = downloadPathList
.get(0)
Expand Down Expand Up @@ -364,6 +367,7 @@ public static File saveTorrent(Ani ani, Item item) {

return HttpReq.get(torrent, true)
.thenFunction(res -> {
Assert.isTrue(res.isOk(), "status: {}", res.getStatus());
FileUtil.writeFromStream(res.bodyStream(), saveTorrentFile, true);
return saveTorrentFile;
});
Expand Down Expand Up @@ -610,10 +614,6 @@ public static synchronized void download(Ani ani, Item item, String savePath, Fi

if (!torrentFile.exists()) {
log.error("种子下载出现问题 {} {}", name, torrentFile.getAbsolutePath());
MessageUtil.send(ConfigUtil.CONFIG, ani,
StrFormatter.format("种子下载出现问题 {} {}", name, torrentFile.getAbsolutePath()),
MessageEnum.ERROR
);
return;
}
ThreadUtil.sleep(1000);
Expand Down

0 comments on commit 462b74c

Please sign in to comment.