From 66c77b04b9d9db91c7ee236de47b5f57ed7a0a0e Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Sun, 12 Jun 2022 00:58:04 +0800 Subject: [PATCH] =?UTF-8?q?update=EF=BC=9A=E9=9F=B3=E4=B9=90=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E8=BE=93=E5=87=BA=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/yutou/nas/NasApplication.java | 3 ++- .../nas/Services/impl/MusicToolsServiceImpl.java | 16 +++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) 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; }