移除所有内置源

This commit is contained in:
lyswhut 2023-10-18 20:34:19 +08:00
parent 3cd5519e0a
commit b0ae614d2a
6 changed files with 34 additions and 40 deletions

View File

@ -8,4 +8,5 @@
### 其他 ### 其他
- 移除所有内置源由于收到腾讯投诉要求停止提供软件内置的连接到他们平台的在线播放及下载服务所以从即日2023年10月18日起LX本身不再提供上述服务
- 更新许可协议的排版,使其看起来更加清晰明了,更新数据来源原理说明 - 更新许可协议的排版,使其看起来更加清晰明了,更新数据来源原理说明

View File

@ -2,7 +2,7 @@ const defaultSetting: LX.AppSetting = {
version: '2.0', version: '2.0',
'common.isAutoTheme': false, 'common.isAutoTheme': false,
'common.langId': null, 'common.langId': null,
'common.apiSource': 'temp', 'common.apiSource': 'empty',
'common.sourceNameType': 'alias', 'common.sourceNameType': 'alias',
'common.shareType': 'system', 'common.shareType': 'system',
'common.isAgreePact': false, 'common.isAgreePact': false,

View File

@ -22,7 +22,7 @@ export const setUserApi = (apiId: string) => {
// }) // })
} else { } else {
// @ts-expect-error // @ts-expect-error
global.lx.qualityList = musicSdk.supportQuality[apiId] as LX.QualityList global.lx.qualityList = musicSdk.supportQuality[apiId] ?? {}
// apiSource.value = apiId // apiSource.value = apiId
// void setUserApiAction(apiId) // void setUserApiAction(apiId)
} }

View File

@ -14,7 +14,7 @@ const hello = async(urlInfo: LX.Sync.UrlInfo) => request(`${urlInfo.httpProtocol
let result = verRxp.exec(text)?.[1] let result = verRxp.exec(text)?.[1]
if (result != null) { if (result != null) {
const servVer = parseInt(result) const servVer = parseInt(result)
const localVer = parseInt(verRxp.exec(SYNC_CODE.helloMsg)[1]) const localVer = parseInt(verRxp.exec(SYNC_CODE.helloMsg)![1])
if (servVer > localVer) throw new Error(SYNC_CODE.highServiceVersion) if (servVer > localVer) throw new Error(SYNC_CODE.highServiceVersion)
else if (servVer < localVer) throw new Error(SYNC_CODE.lowServiceVersion) else if (servVer < localVer) throw new Error(SYNC_CODE.lowServiceVersion)
} }
@ -99,6 +99,7 @@ const auth = async(urlInfo: LX.Sync.UrlInfo, serverId: string, authCode?: string
export default async(urlInfo: LX.Sync.UrlInfo, authCode?: string) => { export default async(urlInfo: LX.Sync.UrlInfo, authCode?: string) => {
console.log('connect: ', urlInfo.href, authCode) console.log('connect: ', urlInfo.href, authCode)
console.log(`${urlInfo.httpProtocol}//${urlInfo.hostPath}/hello`)
if (!await hello(urlInfo)) throw new Error(SYNC_CODE.connectServiceFailed) if (!await hello(urlInfo)) throw new Error(SYNC_CODE.connectServiceFailed)
const serverId = await getServerId(urlInfo) const serverId = await getServerId(urlInfo)
if (!serverId) throw new Error(SYNC_CODE.getServiceIdFailed) if (!serverId) throw new Error(SYNC_CODE.getServiceIdFailed)

View File

@ -1,37 +0,0 @@
// Support qualitys: 128k 320k flac wav
module.exports = [
{
id: 'test',
name: '测试接口',
disabled: false,
supportQualitys: {
kw: ['128k'],
kg: ['128k'],
tx: ['128k'],
wy: ['128k'],
mg: ['128k'],
// bd: ['128k'],
},
},
{
id: 'temp',
name: '临时接口',
disabled: false,
supportQualitys: {
kw: ['128k'],
},
},
{
id: 'direct',
name: '直连接口',
disabled: false,
supportQualitys: {
kw: ['128k'],
kg: ['128k'],
tx: ['128k'],
wy: ['128k'],
mg: ['128k', '320k'],
},
},
]

View File

@ -0,0 +1,29 @@
// Support qualitys: 128k 320k flac wav
const sources: Array<{
id: string
name: string
disabled: boolean
supportQualitys: Partial<Record<LX.OnlineSource, LX.Quality[]>>
}> = [
{
id: 'empty',
name: 'empty',
disabled: false,
supportQualitys: {},
},
{
id: 'direct',
name: '直连接口',
disabled: false,
supportQualitys: {
kw: ['128k'],
kg: ['128k'],
tx: ['128k'],
wy: ['128k'],
mg: ['128k'],
},
},
]
export default sources