Skip to content

Commit

Permalink
v3.2.1 TMDB 新增标题新增功能;优化查询逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyPuppy514 committed Apr 30, 2023
1 parent 2cd7612 commit 6cfc314
Show file tree
Hide file tree
Showing 79 changed files with 51 additions and 30 deletions.
5 changes: 5 additions & 0 deletions changelog.en_US.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

# Change Logs

## v3.2.1 2023-04-30

1. TMDB added title add function
2. Optimize search logic

## v3.2.0 2023-04-30

1. Optimize clean title logic
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

# 变更日志

## v3.2.1 2023-04-30

1. TMDB 新增标题新增功能
2. 优化查询逻辑

## v3.2.0 2023-04-30

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.0</version>
<version>3.2.1</version>
<name>JProxy</name>
<description>介于 Sonarr/Radarr 和 Jackett/Prowlarr 之间的代理,主要用于优化查询和提升识别率</description>
<!-- 依赖版本 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.lckp.jproxy.constant.CacheName;
import com.lckp.jproxy.constant.Messages;
import com.lckp.jproxy.constant.SystemConfigKey;
import com.lckp.jproxy.constant.TableField;
import com.lckp.jproxy.entity.TmdbTitle;
import com.lckp.jproxy.model.request.TmdbTitleQueryRequest;
import com.lckp.jproxy.model.response.PageResponse;
Expand Down Expand Up @@ -93,7 +94,14 @@ public ResponseEntity<Void> remove(@RequestBody List<Integer> idList) {
@CacheEvict(cacheNames = { CacheName.SONARR_SEARCH_TITLE, CacheName.INDEXER_SEARCH_OFFSET,
CacheName.SONARR_RESULT_TITLE }, allEntries = true)
public ResponseEntity<Void> save(@RequestBody TmdbTitle tmdbTitle) {
tmdbTitleService.updateById(tmdbTitle);
if (tmdbTitle.getTmdbId() == null) {
List<TmdbTitle> tmdbTitleList = tmdbTitleService.query()
.eq(TableField.TVDB_ID, tmdbTitle.getTvdbId()).list();
if (!tmdbTitleList.isEmpty()) {
tmdbTitle.setTmdbId(tmdbTitleList.get(0).getTmdbId());
}
}
tmdbTitleService.saveOrUpdate(tmdbTitle);
return ResponseEntity.ok().build();
}
}
4 changes: 2 additions & 2 deletions src/main/java/com/lckp/jproxy/util/FormatUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static String cleanTitle(String title, String regex) {
*/
public static String removeYear(String title) {
if (StringUtils.isNotBlank(title)) {
return title.replaceAll(" \\d{4}$", "");
return title.replaceAll(" (19|20)\\d{2}$", "");
}
return "";
}
Expand All @@ -69,7 +69,7 @@ public static String removeYear(String title) {
*/
public static String removeEpisode(String title) {
if (StringUtils.isNotBlank(title)) {
return title.replaceAll(" \\d+$", "");
return title.replaceAll(" 0*(\\d{1,3}|1[0-8]\\d{2})$", "");
}
return "";
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/dist/assets/cloneDeep.c28e1f48.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
1 change: 1 addition & 0 deletions src/main/resources/dist/assets/constants.9d49e7ca.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Loading

0 comments on commit 6cfc314

Please sign in to comment.