更新依赖&版本号(2.10.0-beta.0)

This commit is contained in:
lyswhut
2024-09-21 14:01:59 +08:00
parent 432861780a
commit ae06019bdb
10 changed files with 268 additions and 1371 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ const matchInfo = (scriptInfo: string) => {
for (const [key, len] of Object.entries(INFO_NAMES) as Array<{ [K in keyof INFO_NAMES_Type]: [K, INFO_NAMES_Type[K]] }[keyof INFO_NAMES_Type]>) {
infos[key] ||= ''
if (infos[key] == null) infos[key] = ''
else if (infos[key]!.length > len) infos[key] = infos[key]!.substring(0, len) + '...'
else if (infos[key].length > len) infos[key] = infos[key].substring(0, len) + '...'
}
return infos as Record<keyof typeof INFO_NAMES, string>
+1 -1
View File
@@ -62,7 +62,7 @@ export const getList = async(source: Source): Promise<string[]> => {
return setLists(results)
})
} else {
if (sourceList[source]?.length) return Promise.resolve(sourceList[source]!)
if (sourceList[source]?.length) return Promise.resolve(sourceList[source])
if (!music[source]?.hotSearch) {
setList(source, [])
return Promise.resolve([])
+3 -1
View File
@@ -118,6 +118,8 @@ const getIntv = (musicInfo: LX.Music.MusicInfo) => {
return intv
}
export type SortFieldName = 'name' | 'singer' | 'albumName' | 'interval' | 'source'
export type SortFieldType = 'up' | 'down' | 'random'
/**
* 排序歌曲
* @param list 歌曲列表
@@ -126,7 +128,7 @@ const getIntv = (musicInfo: LX.Music.MusicInfo) => {
* @param localeId 排序语言
* @returns
*/
export const sortListMusicInfo = async(list: LX.Music.MusicInfo[], sortType: 'up' | 'down' | 'random', fieldName: 'name' | 'singer' | 'albumName' | 'interval' | 'source', localeId: string) => {
export const sortListMusicInfo = async(list: LX.Music.MusicInfo[], sortType: SortFieldType, fieldName: SortFieldName, localeId: string) => {
// console.log(sortType, fieldName, localeId)
// const locale = new Intl.Locale(localeId)
switch (sortType) {