Skip to content

Commit 39f9b59

Browse files
authored
fix the total topic count with thousand separators (#82)
1 parent 983c780 commit 39f9b59

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

app/src/main/java/me/ghui/v2er/network/bean/NodeTopicInfo.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
public class NodeTopicInfo extends BaseInfo {
2222

2323
@Pick("span.topic-count strong")
24-
private int total;
24+
public String totalStr;
2525
@Pick(value = "a[href*=favorite/] ", attr = Attrs.HREF)
2626
private String favoriteLink;
2727
@Pick("div.box div.cell:has(table)")
@@ -32,7 +32,11 @@ public void setItems(List<Item> items) {
3232
}
3333

3434
public int getTotal() {
35-
return total;
35+
try {
36+
return Integer.parseInt(totalStr.replaceAll("[^0-9]", ""));
37+
} catch (Exception e) {
38+
return 0;
39+
}
3640
}
3741

3842
public List<Item> getItems() {
@@ -66,7 +70,7 @@ public String getOnce() {
6670
public String toString() {
6771
return "NodeTopicInfo{" +
6872
"favoriteLink=" + favoriteLink +
69-
",total=" + total +
73+
",total=" + totalStr +
7074
", items=" + items +
7175
'}';
7276
}

0 commit comments

Comments
 (0)