Skip to content

Commit

Permalink
v3.1.8 新增版本号展示及升级提醒
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyPuppy514 committed Apr 16, 2023
1 parent 995b2ee commit bd284bd
Show file tree
Hide file tree
Showing 66 changed files with 93 additions and 55 deletions.
6 changes: 5 additions & 1 deletion changelog.en_US.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@

[中文](https://github.com/LuckyPuppy514/jproxy/blob/main/changelog.md) | [English](https://github.com/LuckyPuppy514/jproxy/blob/main/changelog.en_US.md)
[中文](https://github.com/LuckyPuppy514/jproxy/blob/main/changelog.md) | English

# Change Logs

## v3.1.8 2023-04-17

1. Added version display and upgrade prompt

## v3.1.7 2023-04-16

1. Add file rename switch
Expand Down
6 changes: 5 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@

[中文](https://github.com/LuckyPuppy514/jproxy/blob/main/changelog.md) | [English](https://github.com/LuckyPuppy514/jproxy/blob/main/changelog.en_US.md)
简体中文 | [English](https://github.com/LuckyPuppy514/jproxy/blob/main/changelog.en_US.md)

# 变更日志

## v3.1.8 2023-04-17

1. 新增版本号展示及版本升级提示

## v3.1.7 2023-04-16

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.1.7</version>
<version>3.1.8</version>
<name>JProxy</name>
<description>介于 Sonarr/Radarr 和 Jackett/Prowlarr 之间的代理,主要用于优化查询和提升识别率</description>
<!-- 依赖版本 -->
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/lckp/jproxy/constant/ApiField.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,5 @@ public class ApiField {

public static final String TRANSMISSION_NAME = "name";

public static final String GITHUB_TAG_NAME = "tag_name";
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.lckp.jproxy.constant.ApiField;
import com.lckp.jproxy.constant.CacheName;
import com.lckp.jproxy.entity.SystemConfig;
import com.lckp.jproxy.service.ISystemCacheService;
Expand Down Expand Up @@ -47,12 +50,38 @@ public class SystemConfigController implements CommandLineRunner {

private final RestTemplate restTemplate;

@Value("${project.version}")
private String projectVersion;

@Value("${rule.location}")
private String ruleLocation;

@Value("${rule.location-backup}")
private String ruleLocationBackup;

private String latestVersion;

@Operation(summary = "版本号")
@GetMapping("/version")
public ResponseEntity<String> version() {
if (StringUtils.isBlank(latestVersion)) {
try {
latestVersion = JSON.parseObject(restTemplate.getForObject(
"https://api.github.com/repos/LuckyPuppy514/jproxy/releases/latest", String.class))
.getString(ApiField.GITHUB_TAG_NAME);
if (StringUtils.isNotBlank(latestVersion)) {
latestVersion = latestVersion.replace("v", "");
}
} catch (Exception e) {
log.debug("获取最新版本号出错:{}", e.getMessage());
}
}
if ((projectVersion).equals(latestVersion)) {
return ResponseEntity.ok(projectVersion);
}
return ResponseEntity.ok(projectVersion + " 🚨");
}

@Operation(summary = "查询")
@GetMapping("/query")
public ResponseEntity<List<SystemConfig>> query() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private synchronized RadarrTitle syncAndGetRadarrTitle(String title) {
radarrTitleService.sync();
radarrTitle = radarrTitleService.queryByTitle(title);
if (radarrTitle == null) {
log.error("找不到匹配的标题:{}", title);
log.debug("找不到匹配的标题:{}", title);
radarrTitle = new RadarrTitle();
radarrTitle.setTitle(title);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private synchronized SonarrTitle syncAndGetSonarrTitle(String title) {
tmdbTitleService.sync(sonarrTitleService.queryNeedSyncTmdbTitle());
sonarrTitle = sonarrTitleService.queryByTitle(title);
if (sonarrTitle == null) {
log.error("找不到匹配的标题:{}", title);
log.debug("找不到匹配的标题:{}", title);
sonarrTitle = new SonarrTitle();
sonarrTitle.setTitle(title);
}
Expand Down
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
27 changes: 0 additions & 27 deletions src/main/resources/dist/assets/default-layout.46555b66.js

This file was deleted.

Binary file not shown.
27 changes: 27 additions & 0 deletions src/main/resources/dist/assets/default-layout.62cc916b.js

Large diffs are not rendered by default.

Binary file not shown.
Binary file removed src/main/resources/dist/assets/index.0dfd30ae.js.gz
Binary file not shown.

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

Binary file not shown.
Binary file removed src/main/resources/dist/assets/index.1f7aa4b0.js.gz
Binary file not shown.
Binary file removed src/main/resources/dist/assets/index.25a2a4f4.js.gz
Binary file not shown.
Loading

0 comments on commit bd284bd

Please sign in to comment.