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

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(() -> {
long startTime = System.currentTimeMillis();
QQBotManager.getInstance().sendMessage("开始扫描音乐夹");
musicDataDao.truncate();
isScan = true;
scan(new File(musicPath));
isScan = false;
com.yutou.nas.utils.Log.i("扫描完成");
Log.i("扫描完成");
QQBotManager.getInstance().sendMessage("音乐扫描完成,共" + getLength() + "首歌,耗时:"
+ (System.currentTimeMillis() - startTime));
}).start();