From e58cb29656b1749b2295f50bf742cf17ef1f8234 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Mon, 14 Nov 2022 14:06:17 +0800 Subject: [PATCH] =?UTF-8?q?fix=E6=96=B0=E5=A2=9E=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E7=BA=AF=E9=9F=B3=E4=B9=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nas/Services/impl/MusicToolsServiceImpl.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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();