Merge pull request #1 from HeartAge/master

update
This commit is contained in:
s-yh-china authored and GitHub committed 2021-01-19 23:26:56 +08:00
commit 3f02071c7f
5 files changed
+86 -7

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ plugins {
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '6.1.0'
}
version = "2.8.1"
version = "2.8.2"
repositories {
jcenter()
@@ -108,12 +108,11 @@ public class AllMusic {
}
public static void stop() {
clearVote();
PlayMusic.stop();
if (isRun)
Side.Send("[Stop]", false);
try {
clearVote();
logs.stop();
Side.Send("[Stop]", false);
PlayMusic.stop();
} catch (IOException e) {
e.printStackTrace();
}
@@ -10,6 +10,7 @@ import Color_yr.AllMusic.MusicAPI.MusicAPI1.GetMusicList.DataOBJ;
import Color_yr.AllMusic.MusicAPI.MusicAPI1.GetMusicLyric.LyricOBJ;
import Color_yr.AllMusic.MusicAPI.MusicAPI1.GetMusicSearch.SearchDataOBJ;
import Color_yr.AllMusic.MusicAPI.MusicAPI1.GetMusicSearch.songs;
import Color_yr.AllMusic.MusicAPI.MusicAPI1.GetProgramInfo.PrInfoOBJ;
import Color_yr.AllMusic.MusicAPI.SongInfo.SongInfo;
import Color_yr.AllMusic.MusicAPI.SongLyric.LyricDo;
import Color_yr.AllMusic.MusicAPI.SongLyric.LyricSave;
@@ -47,7 +48,24 @@ public class API1 implements IMusicAPI {
info = new SongInfo(temp.getAuthor(), temp.getName(),
ID, temp.getAlia(), player, temp.getAl(), isList, temp.getLength());
} else {
AllMusic.log.warning("§d[AllMusic]§c歌曲信息获取为空");
Res res1 = HttpGet.realData(AllMusic.getConfig().getMusic_Url() + "/dj/program/detail?id=", ID);
if (res1 != null && res1.isOk()) {
PrInfoOBJ temp1 = new Gson().fromJson(res1.getData(), PrInfoOBJ.class);
if (temp1.isOK()) {
Res res2 = HttpGet.realData(AllMusic.getConfig().getMusic_Url() + "/song/detail?ids=", temp1.getId());
if (res2 != null && res2.isOk()) {
InfoOBJ temp2 = new Gson().fromJson(res2.getData(), InfoOBJ.class);
if (temp2.isok()) {
info = new SongInfo(temp1.getDj(), temp1.getName(),
temp1.getId(), temp2.getAlia(), player, temp2.getAl(), isList, temp2.getLength());
} else {
AllMusic.log.warning("§d[AllMusic]§c歌曲信息获取为空");
}
}
} else {
AllMusic.log.warning("§d[AllMusic]§c歌曲信息获取为空");
}
}
}
}
return info;
@@ -0,0 +1,62 @@
package Color_yr.AllMusic.MusicAPI.MusicAPI1.GetProgramInfo;
public class PrInfoOBJ {
private program program;
public boolean isOK(){
return (program != null && program.getMainSong().getName() != null);
}
public String getDj() {
return program.getDj().getBrand();
}
public String getId(){
return String.valueOf(program.getMainSong().getId());
}
public String getName(){
return program.getMainSong().getName();
}
}
class mainSong{
private String name;
private int id;
public int getId() {
return id;
}
public String getName() {
return name;
}
}
class dj{
private String brand;
public String getBrand() {
return brand;
}
}
class program{
private mainSong mainSong;
private dj dj;
public dj getDj() {
return dj;
}
public mainSong getMainSong() {
return mainSong;
}
}
@@ -72,7 +72,7 @@ class PlayGo extends Thread {
@Override
public synchronized void run() {
while (true) {
while (AllMusic.isRun) {
if (PlayMusic.getSize() == 0) {
try {
Hud.SendHudNowData();