diff --git a/UPDATE.md b/UPDATE.md index 6c6456d..74aa436 100644 --- a/UPDATE.md +++ b/UPDATE.md @@ -1 +1 @@ -支持设置RSS超时时间 +优化 `仅在主RSS更新后删除备用RSS` \ No newline at end of file diff --git a/pom.xml b/pom.xml index 991bec1..9aaedb9 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ ani.rss ani-rss - 1.1.221 + 1.1.222 11 diff --git a/src/main/java/ani/rss/util/TorrentUtil.java b/src/main/java/ani/rss/util/TorrentUtil.java index ab77ca7..4c17375 100644 --- a/src/main/java/ani/rss/util/TorrentUtil.java +++ b/src/main/java/ani/rss/util/TorrentUtil.java @@ -90,6 +90,11 @@ public static synchronized void downloadAni(Ani ani) { }) .count(); + List downloadPathList = getDownloadPath(ani); + String savePath = downloadPathList + .get(0) + .toString(); + for (Item item : items) { log.debug(JSONUtil.formatJsonStr(GsonStatic.toJson(item))); String reName = item.getReName(); @@ -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) { @@ -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 tags = torrentsInfo.getTags(); @@ -182,16 +194,11 @@ public static synchronized void downloadAni(Ani ani) { log.info("添加下载 {}", reName); File saveTorrent = saveTorrent(ani, item); - List 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);