Skip to content

Commit

Permalink
1.1.169
Browse files Browse the repository at this point in the history
  • Loading branch information
wushuo894 committed Nov 1, 2024
1 parent 3813906 commit 3d75f0d
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions src/main/java/ani/rss/util/ItemsUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,16 @@ public static List<Item> getItems(Ani ani, String xml, Item newItem) {
.setPubDate(pubDate);

// 进行过滤
if (exclude.stream().noneMatch(s -> ReUtil.contains(s, addNewItem.getTitle()))) {
continue;
if (!exclude.isEmpty()) {
if (exclude.stream().anyMatch(s -> ReUtil.contains(s, addNewItem.getTitle()))) {
continue;
}
}

if (!match.isEmpty()) {
if (match.stream().anyMatch(s -> !ReUtil.contains(s, addNewItem.getTitle()))) {
continue;
}
}

// 全局排除
Expand All @@ -201,19 +209,6 @@ public static List<Item> getItems(Ani ani, String xml, Item newItem) {
items.add(addNewItem);
}

// 匹配规则
items = items.stream().filter(it -> {
if (match.isEmpty()) {
return true;
}
for (String string : match) {
if (ReUtil.contains(string, it.getTitle())) {
return true;
}
}
return false;
}).collect(Collectors.toList());

items = items.stream()
.filter(item -> {
try {
Expand Down

0 comments on commit 3d75f0d

Please sign in to comment.