修改scheme校验

pull/1094/head
lyswhut 2022-12-26 14:13:18 +08:00
parent cc7ad7c71f
commit 54ddb7473b
2 changed files with 3 additions and 1 deletions

View File

@ -125,6 +125,8 @@ const usePlayMusic = () => {
{ key: 'copyrightId', types: ['string', 'number'], required: true, max: 64 },
{ key: 'lrcUrl', types: ['string'], max: 1024 },
{ key: 'trcUrl', types: ['string'], max: 1024 },
{ key: 'mrcUrl', types: ['string'], max: 1024 },
], musicInfo)
break
default: throw new Error('Unknown source: ' + musicInfo.source)

View File

@ -18,7 +18,7 @@ export const sourceVerify = source => {
if (!sources.includes(source)) throw new Error('Source no match')
}
export const qualitys = ['128k', '320k', 'flac', 'flac32bit']
export const qualitys = ['128k', '320k', 'flac', 'flac24bit']
export const qualityFilter = (source, types) => {
types = types.filter(({ type }) => qualitys.includes(type)).map(({ type, size, hash }) => {
if (size != null && typeof size != 'string') throw new Error(type + ' size type no match')