Skip to content

Commit

Permalink
Merge pull request #148 from wushuo894/test
Browse files Browse the repository at this point in the history
1.1.222
  • Loading branch information
wushuo894 authored Jan 19, 2025
2 parents 3c5d69c + 372671d commit 7eb6599
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion UPDATE.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
支持设置RSS超时时间
优化 `仅在主RSS更新后删除备用RSS`
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.221</version>
<version>1.1.222</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand Down
21 changes: 14 additions & 7 deletions src/main/java/ani/rss/util/TorrentUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ public static synchronized void downloadAni(Ani ani) {
})
.count();

List<File> downloadPathList = getDownloadPath(ani);
String savePath = downloadPathList
.get(0)
.toString();

for (Item item : items) {
log.debug(JSONUtil.formatJsonStr(GsonStatic.toJson(item)));
String reName = item.getReName();
Expand All @@ -104,7 +109,7 @@ public static synchronized void downloadAni(Ani ani) {
continue;
}
// .5 集
Boolean is5 = episode.intValue() != episode;
boolean is5 = episode.intValue() != episode;

Date pubDate = item.getPubDate();
if (Objects.nonNull(pubDate) && delayedDownload > 0) {
Expand All @@ -120,7 +125,14 @@ public static synchronized void downloadAni(Ani ani) {
TorrentsInfo backRSS = torrentsInfos
.stream()
.filter(torrentsInfo -> {
if (!reName.equals(torrentsInfo.getName())) {
if (!torrentsInfo.getDownloadDir().equals(savePath)) {
return false;
}
if (!ReUtil.contains(StringEnum.SEASON_REG, torrentsInfo.getName())) {
return false;
}
String s = ReUtil.get(StringEnum.SEASON_REG, torrentsInfo.getName(), 0);
if (!s.equals(ReUtil.get(StringEnum.SEASON_REG, reName, 0))) {
return false;
}
List<String> tags = torrentsInfo.getTags();
Expand Down Expand Up @@ -182,16 +194,11 @@ public static synchronized void downloadAni(Ani ani) {

log.info("添加下载 {}", reName);
File saveTorrent = saveTorrent(ani, item);
List<File> downloadPathList = getDownloadPath(ani);

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

String savePath = downloadPathList
.get(0)
.toString();

int size = ItemsUtil.currentEpisodeNumber(ani, items);
if (size > 0 && ani.getCurrentEpisodeNumber() < size) {
ani.setCurrentEpisodeNumber(size);
Expand Down

0 comments on commit 7eb6599

Please sign in to comment.