From b10864baeba60aed169f39539ccef8b6f0ef0cec Mon Sep 17 00:00:00 2001
From: LuckyPuppy514 <122154133@qq.com>
Date: Tue, 4 Jun 2024 20:40:32 +0800
Subject: [PATCH] =?UTF-8?q?v3.4.4=20=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=91=BD?=
=?UTF-8?q?=E5=90=8D=E6=97=B6=E8=B7=AF=E5=BE=84=E5=B5=8C=E5=A5=97=E7=9A=84?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
changelog.en_US.md | 4 ++++
changelog.md | 4 ++++
pom.xml | 2 +-
src/main/java/com/lckp/jproxy/task/RadarrRenameTask.java | 5 +++--
src/main/java/com/lckp/jproxy/task/SonarrRenameTask.java | 5 +++--
src/main/resources/database/changelog/v3.4.4.sql | 5 +++++
6 files changed, 20 insertions(+), 5 deletions(-)
create mode 100644 src/main/resources/database/changelog/v3.4.4.sql
diff --git a/changelog.en_US.md b/changelog.en_US.md
index b96ebc4..5ee6b3a 100644
--- a/changelog.en_US.md
+++ b/changelog.en_US.md
@@ -3,6 +3,10 @@
# Change Logs
+## v3.4.4 2024-06-04
+
+👻 Fix the issue of nested path while renaming
+
## v3.4.3 2024-02-20
🚀 Optimize radarr title matching logic
diff --git a/changelog.md b/changelog.md
index 834a691..4a65a95 100644
--- a/changelog.md
+++ b/changelog.md
@@ -3,6 +3,10 @@
# 变更日志
+## v3.4.4 2024-06-04
+
+👻 修复重命名时路径嵌套的问题
+
## v3.4.3 2024-02-20
🚀 优化 Radarr 标题匹配逻辑
diff --git a/pom.xml b/pom.xml
index bb27d55..6e4ec79 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
com.lckp
jproxy
- 3.4.3
+ 3.4.4
JProxy
介于 Sonarr/Radarr 和 Jackett/Prowlarr 之间的代理,主要用于优化查询和提升识别率
diff --git a/src/main/java/com/lckp/jproxy/task/RadarrRenameTask.java b/src/main/java/com/lckp/jproxy/task/RadarrRenameTask.java
index 3192316..9e32177 100644
--- a/src/main/java/com/lckp/jproxy/task/RadarrRenameTask.java
+++ b/src/main/java/com/lckp/jproxy/task/RadarrRenameTask.java
@@ -122,8 +122,9 @@ public synchronized void run() {
if (extension.matches(Common.SUBTITLE_EXTENSION_REGEX)) {
newFileName = newFileName + "." + subtitleNo++;
}
- newFileName = newFileName + " "
- + sourceTitle.substring(sourceTitle.indexOf("["))
+ int index = sourceTitle.indexOf(" [");
+ newFileName = newFileName
+ + (index > -1 ? sourceTitle.substring(index) : "")
+ extension;
}
String newFilePath;
diff --git a/src/main/java/com/lckp/jproxy/task/SonarrRenameTask.java b/src/main/java/com/lckp/jproxy/task/SonarrRenameTask.java
index df86fd7..7a90e6f 100644
--- a/src/main/java/com/lckp/jproxy/task/SonarrRenameTask.java
+++ b/src/main/java/com/lckp/jproxy/task/SonarrRenameTask.java
@@ -149,8 +149,9 @@ public synchronized void run() {
if (extension.matches(Common.SUBTITLE_EXTENSION_REGEX)) {
newFileName = newFileName + "." + subtitleNo++;
}
- newFileName = newFileName + " "
- + sourceTitle.substring(sourceTitle.indexOf("["))
+ int index = sourceTitle.indexOf(" [");
+ newFileName = newFileName
+ + (index > -1 ? sourceTitle.substring(index) : "")
+ extension;
}
}
diff --git a/src/main/resources/database/changelog/v3.4.4.sql b/src/main/resources/database/changelog/v3.4.4.sql
new file mode 100644
index 0000000..c0c60dd
--- /dev/null
+++ b/src/main/resources/database/changelog/v3.4.4.sql
@@ -0,0 +1,5 @@
+--liquibase formatted sql logicalFilePath:/database/changelog/v3.4.4.sql
+--changeset LuckyPuppy514:1
+--comment: 更新净标题正则表达式
+UPDATE system_config SET value='(`|,|~|!|@|#|%|&|_|=|''|"|:|<|>|-|—|·|,|~|、|。|‘|’|“|”|?|!|:|(|)|【|】|《|》|♀|/)' WHERE id=16;
+--rollback UPDATE system_config SET value='(`|,|~|!|@|#|%|&|_|=|''|"|:|<|>|-|—|·|,|~|、|。|‘|’|“|”|?|!|:|(|)|【|】|《|》|♀)' WHERE id=16;
\ No newline at end of file