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 1d8bd0f..9bb7978 100644 --- a/src/main/java/com/yutou/nas/Services/impl/MusicToolsServiceImpl.java +++ b/src/main/java/com/yutou/nas/Services/impl/MusicToolsServiceImpl.java @@ -126,14 +126,15 @@ public class MusicToolsServiceImpl implements IMusicToolsService { example.createCriteria().andFileLike(tmpPath.replace(File.separator, replacement) + "%"); } main = musicDataDao.selectByExample(example, delPath); + }else { + tmpPath = tmpPath.replace(File.separator, replacement) + .replace("+", "\\+") + .replace("[", "\\[") + .replace("(", "\\(") + .replace(")", "\\)") + .replace("]", "\\]"); + main.addAll(musicDataDao.selectByRegexp(tmpPath + replacement + "([^" + replacement + "]+)$", delPath)); } - tmpPath = tmpPath.replace(File.separator, replacement) - .replace("+", "\\+") - .replace("[", "\\[") - .replace("(", "\\(") - .replace(")", "\\)") - .replace("]", "\\]"); - main.addAll(musicDataDao.selectByRegexp(tmpPath + replacement + "([^" + replacement + "]+)$", delPath)); if (!path.equals(AppData.defaultMusicPath) && !"root".equals(path)) { MusicData t2 = new MusicData();