diff --git a/src/main/java/com/yutou/nas/NasApplication.java b/src/main/java/com/yutou/nas/NasApplication.java index e299394..227023c 100644 --- a/src/main/java/com/yutou/nas/NasApplication.java +++ b/src/main/java/com/yutou/nas/NasApplication.java @@ -12,7 +12,8 @@ import org.springframework.context.annotation.Import; @Import(BTDownloadManager.class) @SpringBootApplication public class NasApplication { - public static final String version="1.2.13"; + public static final String version = "1.2.14"; + public static void main(String[] args) { SpringApplication.run(NasApplication.class, args); AppData.defaultMusicPath = (String) ConfigTools.load(ConfigTools.CONFIG, "musicDir"); 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 3f99124..196589b 100644 --- a/src/main/java/com/yutou/nas/Services/impl/MusicToolsServiceImpl.java +++ b/src/main/java/com/yutou/nas/Services/impl/MusicToolsServiceImpl.java @@ -1,12 +1,10 @@ package com.yutou.nas.Services.impl; -import com.alibaba.fastjson2.JSONObject; import com.yutou.nas.Datas.AppData; +import com.yutou.nas.Services.IMusicToolsService; import com.yutou.nas.mybatis.dao.MusicDataDao; import com.yutou.nas.mybatis.model.MusicData; import com.yutou.nas.mybatis.model.MusicDataExample; -import com.yutou.nas.Services.IMusicToolsService; - import com.yutou.nas.utils.*; import ealvatag.audio.AudioFile; import ealvatag.audio.AudioFileIO; @@ -26,10 +24,8 @@ import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.text.Collator; +import java.util.*; @Service("MusicToolsService") public class MusicToolsServiceImpl implements IMusicToolsService { @@ -146,6 +142,12 @@ public class MusicToolsServiceImpl implements IMusicToolsService { } getDirList(path, list); list.addAll(main); + + list.sort((o1, o2) -> { + Comparator compare = Collator.getInstance(Locale.CHINA); + return compare.compare(o1.getTitle(),o2.getTitle()); + }); + return list; }