Skip to content

Commit

Permalink
v3.2.3 优化下载器文件重命名逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyPuppy514 committed May 28, 2023
1 parent 54321fa commit f7110fd
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 6 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.2.3 2023-05-28

1. Optimize downloader file rename logic

## v3.2.2 2023-05-23

1. Optimize search 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.2.3 2023-05-28

1. 优化下载器文件重命名逻辑

## v3.2.2 2023-05-23

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.2.2</version>
<version>3.2.3</version>
<name>JProxy</name>
<description>介于 Sonarr/Radarr 和 Jackett/Prowlarr 之间的代理,主要用于优化查询和提升识别率</description>
<!-- 依赖版本 -->
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/lckp/jproxy/constant/Common.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class Common {
// 标题主规则 ID
public static final String MOST_IMPORTANT_TITLE_RULE_ID = "00000000000000000000000000000000";
// 视频文件扩展名正则表达式
public static final String VIDEO_EXTENSION_REGEX = "(\\.(mp4|avi|wmv|flv|mov|mkv|webm|mpg|mpeg|3gp|iso))$";
public static final String VIDEO_AND_SUBTITLE_EXTENSION_REGEX = "(\\.(mp4|avi|wmv|flv|mov|mkv|webm|mpg|mpeg|3gp|iso|ass|srt|ssa|idx|sub))$";
// 时间格式
public static final String DATE_TIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public boolean rename(String hash, String name) {
log.debug("Transmission 种子暂时无法重命名:{}", oldName);
return false;
}
Matcher matcher = Pattern.compile(Common.VIDEO_EXTENSION_REGEX).matcher(oldName);
Matcher matcher = Pattern.compile(Common.VIDEO_AND_SUBTITLE_EXTENSION_REGEX).matcher(oldName);
if (matcher.find()) {
String extension = matcher.group(1);
name = name + extension;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/lckp/jproxy/task/RadarrRenameTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public synchronized void run() {
String oldFileName = oldFilePath.substring(startIndex);
String newFileName = oldFileName;
Matcher extensionMatcher = Pattern
.compile(Common.VIDEO_EXTENSION_REGEX)
.compile(Common.VIDEO_AND_SUBTITLE_EXTENSION_REGEX)
.matcher(oldFileName);
if (extensionMatcher.find()) {
String extension = extensionMatcher.group(1);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/lckp/jproxy/task/SonarrRenameTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public synchronized void run() {
String oldFileName = oldFilePath.substring(startIndex);
String newFileName = oldFileName;
Matcher extensionMatcher = Pattern
.compile(Common.VIDEO_EXTENSION_REGEX)
.compile(Common.VIDEO_AND_SUBTITLE_EXTENSION_REGEX)
.matcher(oldFileName);
if (extensionMatcher.find()) {
String extension = extensionMatcher.group(1);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/rule/[email protected]

Large diffs are not rendered by default.

0 comments on commit f7110fd

Please sign in to comment.