From 60dc28c5ed8840d24af87d14e215c29f6f3d2fb6 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Sat, 21 Jun 2025 18:12:37 +0800 Subject: [PATCH] =?UTF-8?q?perf(novel-crawl):=20=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E5=B0=8F=E8=AF=B4=E7=AE=80=E4=BB=8B=E6=9C=AB=E5=B0=BE=E5=86=97?= =?UTF-8?q?=E4=BD=99=E7=9A=84=E5=B0=8F=E8=AF=B4=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/java2nb/novel/core/crawl/CrawlParser.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/novel-crawl/src/main/java/com/java2nb/novel/core/crawl/CrawlParser.java b/novel-crawl/src/main/java/com/java2nb/novel/core/crawl/CrawlParser.java index a50fd19..d61921d 100644 --- a/novel-crawl/src/main/java/com/java2nb/novel/core/crawl/CrawlParser.java +++ b/novel-crawl/src/main/java/com/java2nb/novel/core/crawl/CrawlParser.java @@ -110,6 +110,10 @@ public class CrawlParser { } } } + //去除小说简介末尾冗余的小说名 + if (desc.endsWith(bookName)) { + desc = desc.substring(0, desc.length() - bookName.length()); + } //设置书籍简介 book.setBookDesc(desc); if (StringUtils.isNotBlank(ruleBean.getStatusPatten())) { @@ -161,7 +165,7 @@ public class CrawlParser { } public boolean parseBookIndexAndContent(String sourceBookId, Book book, RuleBean ruleBean, - Map existBookIndexMap, CrawlBookChapterHandler handler) throws InterruptedException{ + Map existBookIndexMap, CrawlBookChapterHandler handler) throws InterruptedException { Date currentDate = new Date();