扫描音乐前清空数据库,以防止重复

This commit is contained in:
Yutousama 2022-05-17 15:11:50 +08:00
parent a21a875261
commit 7b533bb0df

View File

@ -61,10 +61,11 @@ public class MusicToolsServiceImpl implements IMusicToolsService {
new Thread(() -> { new Thread(() -> {
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
QQBotManager.getInstance().sendMessage("开始扫描音乐夹"); QQBotManager.getInstance().sendMessage("开始扫描音乐夹");
musicDataDao.truncate();
isScan = true; isScan = true;
scan(new File(musicPath)); scan(new File(musicPath));
isScan = false; isScan = false;
com.yutou.nas.utils.Log.i("扫描完成"); Log.i("扫描完成");
QQBotManager.getInstance().sendMessage("音乐扫描完成,共" + getLength() + "首歌,耗时:" QQBotManager.getInstance().sendMessage("音乐扫描完成,共" + getLength() + "首歌,耗时:"
+ (System.currentTimeMillis() - startTime)); + (System.currentTimeMillis() - startTime));
}).start(); }).start();