Skip to content

Commit

Permalink
v3.3.6 优化匹配逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyPuppy514 committed Aug 6, 2023
1 parent 07eec32 commit 3d2cf02
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 18 deletions.
4 changes: 4 additions & 0 deletions changelog.en_US.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

# Change Logs

## v3.3.6 2023-08-06

1. Optimize matching logic

## v3.3.5 2023-08-06

1. Optimize language matching logic
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

# 变更日志

## v3.3.6 2023-08-06

1. 优化匹配逻辑

## v3.3.5 2023-08-06

1. 优化语言匹配逻辑
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!-- 项目信息 -->
<groupId>com.lckp</groupId>
<artifactId>jproxy</artifactId>
<version>3.3.5</version>
<version>3.3.6</version>
<name>JProxy</name>
<description>介于 Sonarr/Radarr 和 Jackett/Prowlarr 之间的代理,主要用于优化查询和提升识别率</description>
<!-- 依赖版本 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,11 @@ public String executeFormatRule(String xml) {
log.debug("索引器格式化失败:{} ==> 未匹配到标题", text);
continue;
}
// 从 description 提取语言信息
Element descriptionElement = item.element(ApiField.INDEXER_DESCRIPTION);
if (descriptionElement != null && StringUtils.isNotBlank(descriptionElement.getText())) {
if (descriptionElement != null) {
String description = descriptionElement.getText();
String language = radarrTitleService.format(description, "{" + Token.LANGUAGE + "}",
tokenRuleMap);
if (StringUtils.isNotBlank(language)) {
newText = FormatUtil.replaceToken(Token.LANGUAGE, language, newText);
if (StringUtils.isNotBlank(description)) {
text = text + " " + FormatUtil.PLACEHOLDER_SEPARATOR + " " + description;
}
}
newText = radarrTitleService.format(text, newText, tokenRuleMap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,11 @@ public String executeFormatRule(String xml) {
log.debug("索引器格式化失败:{} ==> 未匹配到标题", text);
continue;
}
// 从 description 提取语言和集数信息
Element descriptionElement = item.element(ApiField.INDEXER_DESCRIPTION);
if (descriptionElement != null && StringUtils.isNotBlank(descriptionElement.getText())) {
if (descriptionElement != null) {
String description = descriptionElement.getText();
String language = sonarrTitleService.format(description, "{" + Token.LANGUAGE + "}",
tokenRuleMap);
String episode = sonarrTitleService.format(description, "{" + Token.EPISODE + "}",
tokenRuleMap);
if (StringUtils.isNotBlank(language)) {
newText = FormatUtil.replaceToken(Token.LANGUAGE, language, newText);
}
if (StringUtils.isNotBlank(episode)) {
newText = FormatUtil.replaceToken(Token.EPISODE, episode, newText);
if (StringUtils.isNotBlank(description)) {
text = text + " " + FormatUtil.PLACEHOLDER_SEPARATOR + " " + description;
}
}
newText = sonarrTitleService.format(text, newText, tokenRuleMap);
Expand Down

0 comments on commit 3d2cf02

Please sign in to comment.