mirror of
https://github.com/Coloryr/AllMusic.git
synced 2026-11-25 04:04:22 +00:00
up (严重)修复空闲歌单bug
This commit is contained in:
1 parent
336438b980
commit
412d8028d3
5 files changed
+16
-12
No files matched your search
@@ -153,13 +153,14 @@ public class CommandEX {
|
||||
public static void addMusic(Object sender, String name, String[] args) {
|
||||
String musicID;
|
||||
if (args[0].contains("id=") && !args[0].contains("/?userid")) {
|
||||
if (args[0].contains("&user"))
|
||||
if (args[0].contains("&uct2")) {
|
||||
musicID = Function.getString(args[0], "id=", "&uct2");
|
||||
}
|
||||
else if (args[0].contains("&user"))
|
||||
musicID = Function.getString(args[0], "id=", "&user");
|
||||
else
|
||||
musicID = Function.getString(args[0], "id=", null);
|
||||
} else if (args[0].contains("id=") && args[0].contains("&uct2")) {
|
||||
musicID = Function.getString(args[0], "id=", "&uct2");
|
||||
} else if (args[0].contains("song/")) {
|
||||
} else if (args[0].contains("song/")) {
|
||||
if (args[0].contains("/?userid"))
|
||||
musicID = Function.getString(args[0], "song/", "/?userid");
|
||||
else
|
||||
|
||||
@@ -6,18 +6,18 @@ public class InfoObj {
|
||||
private List<Songs> songs;
|
||||
|
||||
public boolean isOk() {
|
||||
return (songs != null && songs.size() != 0);
|
||||
return (songs != null && !songs.isEmpty());
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
if (songs == null || songs.size() == 0)
|
||||
if (songs == null || songs.isEmpty())
|
||||
return "";
|
||||
return songs.get(0).getName();
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
StringBuilder Author = new StringBuilder();
|
||||
if (songs.size() == 0)
|
||||
if (songs.isEmpty())
|
||||
return "";
|
||||
for (ar ar : songs.get(0).getAr()) {
|
||||
Author.append(ar.getName()).append(",");
|
||||
|
||||
@@ -310,10 +310,13 @@ public class DataSql {
|
||||
if (connection.isReadOnly() || connection.isClosed()) {
|
||||
init();
|
||||
}
|
||||
String arrayAsString = String.join(",", list);
|
||||
PreparedStatement pstmt = connection.prepareStatement("INSERT INTO allmusic_list (sid) VALUES (?)");
|
||||
pstmt.setString(1, arrayAsString);
|
||||
pstmt.execute();
|
||||
// 遍历 List<String> 并插入每个字符串
|
||||
for (String str : list) {
|
||||
pstmt.setString(1, str); // 设置参数
|
||||
pstmt.addBatch(); // 添加到批处理
|
||||
}
|
||||
pstmt.executeBatch();
|
||||
pstmt.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -50,7 +50,7 @@ dependencies {
|
||||
compileOnly 'net.md-5:bungeecord-api:1.20-R0.1-SNAPSHOT'
|
||||
compileOnly "com.github.MilkBowl:VaultAPI:1.7.1"
|
||||
compileOnly 'com.velocitypowered:velocity-api:3.0.0'
|
||||
compileOnly 'me.clip:placeholderapi:2.10.10'
|
||||
compileOnly 'me.clip:placeholderapi:2.11.6'
|
||||
//compileOnly 'net.citizensnpcs:citizens-main:2.0.30-SNAPSHOT'
|
||||
// compileOnly fileTree(dir:'lib',include:['*.jar'])
|
||||
|
||||
|
||||
Reference in new issue
Block a user