fix md5 is null bug
This commit is contained in:
parent
007184031b
commit
0be4bef30e
@ -251,6 +251,8 @@ public class MusicToolsServiceImpl implements IMusicToolsService {
|
|||||||
|| file.getName().endsWith(".dff")
|
|| file.getName().endsWith(".dff")
|
||||||
|| file.getName().endsWith(".cue")
|
|| file.getName().endsWith(".cue")
|
||||||
|| file.getName().endsWith(".m3u")
|
|| file.getName().endsWith(".m3u")
|
||||||
|
|| file.getName().endsWith(".txt")
|
||||||
|
|| file.getName().endsWith(".db")
|
||||||
) {
|
) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -314,6 +316,9 @@ public class MusicToolsServiceImpl implements IMusicToolsService {
|
|||||||
data.setVariablebitrate(header.isVariableBitRate() ? 1 : 0);
|
data.setVariablebitrate(header.isVariableBitRate() ? 1 : 0);
|
||||||
try {
|
try {
|
||||||
data.setMd5(header.getClass().getMethod("getMd5").invoke(header).toString());
|
data.setMd5(header.getClass().getMethod("getMd5").invoke(header).toString());
|
||||||
|
if(data.getMd5().startsWith("00000")&&data.getMd5().endsWith("00000")){
|
||||||
|
throw new NullPointerException("md5 is null");
|
||||||
|
}
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
data.setMd5(Tools.getFileMD5(file));
|
data.setMd5(Tools.getFileMD5(file));
|
||||||
}
|
}
|
||||||
@ -387,6 +392,9 @@ public class MusicToolsServiceImpl implements IMusicToolsService {
|
|||||||
data.setVariablebitrate(header.isVariableBitRate() ? 1 : 0);
|
data.setVariablebitrate(header.isVariableBitRate() ? 1 : 0);
|
||||||
try {
|
try {
|
||||||
data.setMd5(header.getClass().getMethod("getMd5").invoke(header).toString());
|
data.setMd5(header.getClass().getMethod("getMd5").invoke(header).toString());
|
||||||
|
if(data.getMd5().startsWith("00000")&&data.getMd5().endsWith("00000")){
|
||||||
|
throw new NullPointerException("md5 is null");
|
||||||
|
}
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
data.setMd5(Tools.getFileMD5(file));
|
data.setMd5(Tools.getFileMD5(file));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user