diff --git a/src/main/java/com/yutou/nas/Services/impl/MusicToolsServiceImpl.java b/src/main/java/com/yutou/nas/Services/impl/MusicToolsServiceImpl.java index 644c0fa..afea16b 100644 --- a/src/main/java/com/yutou/nas/Services/impl/MusicToolsServiceImpl.java +++ b/src/main/java/com/yutou/nas/Services/impl/MusicToolsServiceImpl.java @@ -114,11 +114,12 @@ public class MusicToolsServiceImpl implements IMusicToolsService { MusicDataExample example = new MusicDataExample(); String replacement = "windows".equals(ConfigTools.load(ConfigTools.CONFIG, "os")) ? "\\\\" : "/"; String tmpPath = path; - if (new File(path).isDirectory()) { + if (isDir) { example.createCriteria().andFileLike(tmpPath.replace(File.separator, replacement) + "%"); main = musicDataDao.selectByExample(example); } tmpPath = tmpPath.replace(File.separator, replacement) + .replace("+", "\\+") .replace("[", "\\[") .replace("(", "\\(") .replace(")", "\\)")