From 68bf2d96fb3a7f20d0b37a3508e6aa1fe4be3a8c Mon Sep 17 00:00:00 2001 From: yutou Date: Thu, 26 Nov 2020 18:21:48 +0800 Subject: [PATCH] update --- src/main/java/com/yutou/tools/home/nas/Data/MusicData.java | 2 +- src/main/java/com/yutou/tools/utils/APIFilter.java | 3 +++ src/main/java/com/yutou/tools/utils/MusicTools.java | 6 ++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/yutou/tools/home/nas/Data/MusicData.java b/src/main/java/com/yutou/tools/home/nas/Data/MusicData.java index 4e2abb6..390d0c8 100644 --- a/src/main/java/com/yutou/tools/home/nas/Data/MusicData.java +++ b/src/main/java/com/yutou/tools/home/nas/Data/MusicData.java @@ -71,7 +71,7 @@ public class MusicData { if (!img.exists()) { img = new File(path, "COVER.jpg"); if (!img.exists()) { - return null; + throw new NullPointerException("没有cover文件"); } } } diff --git a/src/main/java/com/yutou/tools/utils/APIFilter.java b/src/main/java/com/yutou/tools/utils/APIFilter.java index 19983a6..34d3090 100644 --- a/src/main/java/com/yutou/tools/utils/APIFilter.java +++ b/src/main/java/com/yutou/tools/utils/APIFilter.java @@ -39,6 +39,9 @@ public class APIFilter implements Filter { HttpServletResponse response = (HttpServletResponse) servletResponse; String token = request.getParameter("token"); Cookie cookie = Tools.getCookie(request, "user"); + if(StringUtils.isEmpty(token)){ + token="PlVodzYhvxRQbOHKakpKs2dvnoc43Cnk"; + } System.out.println("接收到请求:" + request.getRequestURI() + " " + token); boolean isToken = false; boolean isCookie = false; diff --git a/src/main/java/com/yutou/tools/utils/MusicTools.java b/src/main/java/com/yutou/tools/utils/MusicTools.java index bc0188c..2685f70 100644 --- a/src/main/java/com/yutou/tools/utils/MusicTools.java +++ b/src/main/java/com/yutou/tools/utils/MusicTools.java @@ -396,10 +396,8 @@ public class MusicTools { } public static void main(String[] args) throws Exception { - File file = new File("Z:\\音乐\\秒速5厘米\\【秒速五厘米】OST-桜花抄.flac"); - /*AudioFile audioFile = AudioFileIO.read(file); - AudioHeader header = audioFile.getAudioHeader(); - System.out.println(JSONObject.toJSONString(header));*/ + File file = new File("Z:\\音乐\\总之就是非常酸\\ED\\カノエラナ - 月と星空\\カノエラナ.wav"); + System.out.println(new MusicTools().getMetadata(file)); }