diff --git a/UPDATE.md b/UPDATE.md index 5bec7add..81a1132c 100644 --- a/UPDATE.md +++ b/UPDATE.md @@ -1,3 +1 @@ -tmdb支持获取日语与英文标题 - -旧的获取台湾翻译请再次手动设置一遍 \ No newline at end of file +增加BGM日文标题 diff --git a/pom.xml b/pom.xml index 8154fbe2..d528deb6 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ ani.rss ani-rss - 1.1.207 + 1.1.208 11 diff --git a/src/main/java/ani/rss/entity/Config.java b/src/main/java/ani/rss/entity/Config.java index bb4437a5..fcaaaf7c 100644 --- a/src/main/java/ani/rss/entity/Config.java +++ b/src/main/java/ani/rss/entity/Config.java @@ -298,6 +298,11 @@ public class Config implements Serializable { */ private Boolean webHook; + /** + * BGM日文标题 + */ + private Boolean bgmJpName; + /** * tmdb */ diff --git a/src/main/java/ani/rss/util/AniUtil.java b/src/main/java/ani/rss/util/AniUtil.java index 5daac0b1..a11fcc38 100644 --- a/src/main/java/ani/rss/util/AniUtil.java +++ b/src/main/java/ani/rss/util/AniUtil.java @@ -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 = "无标题"; @@ -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 = "无标题"; } @@ -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(); diff --git a/src/main/java/ani/rss/util/ConfigUtil.java b/src/main/java/ani/rss/util/ConfigUtil.java index a1218ca3..738105f5 100644 --- a/src/main/java/ani/rss/util/ConfigUtil.java +++ b/src/main/java/ani/rss/util/ConfigUtil.java @@ -91,6 +91,7 @@ public class ConfigUtil { .setTelegramFormat("") .setWebHook(false) .setTmdb(false) + .setBgmJpName(false) .setTmdbId(false) .setTmdbLanguage("zh-CN") .setIpWhitelist(false) diff --git a/ui/src/config/Basic.vue b/ui/src/config/Basic.vue index c77c94e7..1c9006f1 100644 --- a/ui/src/config/Basic.vue +++ b/ui/src/config/Basic.vue @@ -38,6 +38,9 @@ + + +