Skip to content

Commit

Permalink
修复订阅在开启只下载最新集时自定禁用不生效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wushuo894 committed Feb 18, 2025
1 parent 770fe8c commit 720334d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
3 changes: 0 additions & 3 deletions src/main/java/ani/rss/util/AniUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,6 @@ public static Ani getAni(String url, String text, String type, String bgmUrl) {

// 自动推断剧集偏移
if (config.getOffset()) {
if (items.isEmpty()) {
return ani;
}
Double offset = -(items.stream()
.map(Item::getEpisode)
.min(Comparator.comparingDouble(i -> i))
Expand Down
23 changes: 16 additions & 7 deletions src/main/java/ani/rss/util/TorrentUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ public static synchronized void downloadAni(Ani ani) {
ItemsUtil.omit(ani, items);
log.debug("{} 共 {} 个", title, items.size());

if (downloadNew && !items.isEmpty()) {
log.debug("{} 已开启只下载最新集", title);
items = List.of(items.get(items.size() - 1));
}

long count = torrentsInfos
.stream()
.filter(it -> {
Expand Down Expand Up @@ -95,12 +90,26 @@ public static synchronized void downloadAni(Ani ani) {
.trim().toLowerCase();

Double episode = item.getEpisode();
// .5 集
boolean is5 = episode.intValue() != episode;

if (notDownload.contains(episode)) {
if (master && !is5) {
currentDownloadCount++;
}
log.debug("已被禁止下载: {}", reName);
continue;
}
// .5 集
boolean is5 = episode.intValue() != episode;

// 只下载最新集
if (downloadNew) {
if (item != items.get(items.size() - 1)) {
if (master && !is5) {
currentDownloadCount++;
}
continue;
}
}

Date pubDate = item.getPubDate();
if (Objects.nonNull(pubDate) && delayedDownload > 0) {
Expand Down

0 comments on commit 720334d

Please sign in to comment.