分离可用音质控制逻辑

This commit is contained in:
lyswhut
2020-04-29 12:33:41 +08:00
parent e51ee8c1ad
commit a62d8304e2
26 changed files with 127 additions and 133 deletions
+3 -8
View File
@@ -8,14 +8,9 @@ import crypto from 'crypto'
const types = ['flac', 'wav', 'ape', '320k', '192k', '128k']
export const getMusicType = (info, type) => {
switch (info.source) {
// case 'kg':
case 'wy':
case 'tx':
return '128k'
case 'xm':
if (type == 'wav') type = '320k'
}
let list = window.globalObj.qualityList[info.source]
if (!list) return '128k'
if (!list.includes(type)) type = list[list.length - 1]
const rangeType = types.slice(types.indexOf(type))
for (const type of rangeType) {
if (info._types[type]) return type