更新依赖&版本号(2.10.0-beta.0)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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([])
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user