Skip to content

Commit

Permalink
修复添加OVA时出现空指针异常
Browse files Browse the repository at this point in the history
  • Loading branch information
wushuo894 committed Sep 23, 2024
1 parent 657ce98 commit f085e16
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion UPDATE.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
支持按照星期展示订阅,旧数据需要手动维护日期
修复添加OVA时出现空指针异常
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.63</version>
<version>1.1.65</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/ani/rss/util/AniUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ public static List<Item> getItems(Ani ani, String xml) {
}

Item newItem = new Item()
.setEpisode(1.0)
.setTitle(itemTitle)
.setReName(itemTitle)
.setTorrent(torrent)
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/ani/rss/util/ItemsUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public static synchronized void omit(Ani ani, List<Item> items) {
if (items.isEmpty()) {
return;
}

Boolean ova = ani.getOva();
if (ova) {
return;
}

int[] array = items.stream().mapToInt(o -> o.getEpisode().intValue()).distinct().toArray();
int max = ArrayUtil.max(array);
int min = ArrayUtil.min(array);
Expand Down

0 comments on commit f085e16

Please sign in to comment.