Skip to content

Commit

Permalink
增加BGM日文标题
Browse files Browse the repository at this point in the history
  • Loading branch information
wushuo894 committed Dec 6, 2024
1 parent 8be82c9 commit c013480
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
4 changes: 1 addition & 3 deletions UPDATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
tmdb支持获取日语与英文标题

旧的获取台湾翻译请再次手动设置一遍
增加BGM日文标题
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ani.rss</groupId>
<artifactId>ani-rss</artifactId>
<version>1.1.207</version>
<version>1.1.208</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/ani/rss/entity/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ public class Config implements Serializable {
*/
private Boolean webHook;

/**
* BGM日文标题
*/
private Boolean bgmJpName;

/**
* tmdb
*/
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/ani/rss/util/AniUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public static Ani getAni(String url) {
* @return
*/
public static Ani getAni(String url, String text, String type, String bgmUrl) {
Config config = ConfigUtil.CONFIG;
type = StrUtil.blankToDefault(type, "mikan");
int season = 1;
String title = "无标题";
Expand Down Expand Up @@ -168,7 +169,13 @@ public static Ani getAni(String url, String text, String type, String bgmUrl) {
String nameCn = bgmInfo.getNameCn();
String name = bgmInfo.getName();

title = StrUtil.blankToDefault(nameCn, name);
Boolean bgmJpName = config.getBgmJpName();
if (bgmJpName) {
title = name;
} else {
title = StrUtil.blankToDefault(nameCn, name);
}

if (StrUtil.isBlank(title)) {
title = "无标题";
}
Expand Down Expand Up @@ -209,7 +216,6 @@ public static Ani getAni(String url, String text, String type, String bgmUrl) {

Integer year = ani.getYear();

Config config = ConfigUtil.CONFIG;
Boolean downloadNew = config.getDownloadNew();
Boolean titleYear = config.getTitleYear();
Boolean tmdb = config.getTmdb();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/ani/rss/util/ConfigUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public class ConfigUtil {
.setTelegramFormat("")
.setWebHook(false)
.setTmdb(false)
.setBgmJpName(false)
.setTmdbId(false)
.setTmdbLanguage("zh-CN")
.setIpWhitelist(false)
Expand Down
3 changes: 3 additions & 0 deletions ui/src/config/Basic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
<el-form-item label="自动推断剧集偏移">
<el-switch v-model:model-value="props.config.offset"/>
</el-form-item>
<el-form-item label="BGM日文标题">
<el-switch v-model:model-value="props.config['bgmJpName']"/>
</el-form-item>
<el-form-item label="TMDB ID">
<div>
<el-switch v-model:model-value="props.config.tmdbId"/>
Expand Down

0 comments on commit c013480

Please sign in to comment.