fix新增过滤纯音乐
This commit is contained in:
parent
eab928a111
commit
3cf9b7da7e
@ -163,8 +163,15 @@ public class MusicController {
|
||||
|
||||
@RequestMapping("/nas/music/random.do")
|
||||
@ResponseBody
|
||||
public String random() {
|
||||
public String random(String filter) {
|
||||
boolean _fieldName = false;
|
||||
if(!StringUtils.isEmpty(filter)){
|
||||
_fieldName="true".equals(filter);
|
||||
}
|
||||
List<MusicData> list = musicTools.getMusicList(true);
|
||||
if(_fieldName) {
|
||||
list.removeIf(data -> data.getTitle().contains("instrumental"));
|
||||
}
|
||||
MusicData data = list.get(Tools.randomCommon(0, list.size() - 1, 1)[0]);
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("code", 0);
|
||||
|
Loading…
Reference in New Issue
Block a user