From c0134806fa54b4105c2e6e9c1aff6fd96d719d36 Mon Sep 17 00:00:00 2001
From: wushuo <2725730722@qq.com>
Date: Sat, 7 Dec 2024 03:32:10 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0BGM=E6=97=A5=E6=96=87?=
=?UTF-8?q?=E6=A0=87=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
UPDATE.md | 4 +---
pom.xml | 2 +-
src/main/java/ani/rss/entity/Config.java | 5 +++++
src/main/java/ani/rss/util/AniUtil.java | 10 ++++++++--
src/main/java/ani/rss/util/ConfigUtil.java | 1 +
ui/src/config/Basic.vue | 3 +++
6 files changed, 19 insertions(+), 6 deletions(-)
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 @@
+
+
+