diff --git a/publish/changeLog.md b/publish/changeLog.md index f443a89..80a6d6a 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -8,4 +8,5 @@ ### 其他 +- 移除所有内置源,由于收到腾讯投诉要求停止提供软件内置的连接到他们平台的在线播放及下载服务,所以从即日(2023年10月18日)起LX本身不再提供上述服务 - 更新许可协议的排版,使其看起来更加清晰明了,更新数据来源原理说明 diff --git a/src/config/defaultSetting.ts b/src/config/defaultSetting.ts index 9c4637b..03c28ff 100644 --- a/src/config/defaultSetting.ts +++ b/src/config/defaultSetting.ts @@ -2,7 +2,7 @@ const defaultSetting: LX.AppSetting = { version: '2.0', 'common.isAutoTheme': false, 'common.langId': null, - 'common.apiSource': 'temp', + 'common.apiSource': 'empty', 'common.sourceNameType': 'alias', 'common.shareType': 'system', 'common.isAgreePact': false, diff --git a/src/core/apiSource.ts b/src/core/apiSource.ts index 3749739..eb9ec06 100644 --- a/src/core/apiSource.ts +++ b/src/core/apiSource.ts @@ -22,7 +22,7 @@ export const setUserApi = (apiId: string) => { // }) } else { // @ts-expect-error - global.lx.qualityList = musicSdk.supportQuality[apiId] as LX.QualityList + global.lx.qualityList = musicSdk.supportQuality[apiId] ?? {} // apiSource.value = apiId // void setUserApiAction(apiId) } diff --git a/src/plugins/sync/client/auth.ts b/src/plugins/sync/client/auth.ts index 319a014..e9bdcb9 100644 --- a/src/plugins/sync/client/auth.ts +++ b/src/plugins/sync/client/auth.ts @@ -14,7 +14,7 @@ const hello = async(urlInfo: LX.Sync.UrlInfo) => request(`${urlInfo.httpProtocol let result = verRxp.exec(text)?.[1] if (result != null) { 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) 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) => { console.log('connect: ', urlInfo.href, authCode) + console.log(`${urlInfo.httpProtocol}//${urlInfo.hostPath}/hello`) if (!await hello(urlInfo)) throw new Error(SYNC_CODE.connectServiceFailed) const serverId = await getServerId(urlInfo) if (!serverId) throw new Error(SYNC_CODE.getServiceIdFailed) diff --git a/src/utils/musicSdk/api-source-info.js b/src/utils/musicSdk/api-source-info.js deleted file mode 100644 index 587e850..0000000 --- a/src/utils/musicSdk/api-source-info.js +++ /dev/null @@ -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'], - }, - }, -] diff --git a/src/utils/musicSdk/api-source-info.ts b/src/utils/musicSdk/api-source-info.ts new file mode 100644 index 0000000..af5f5d4 --- /dev/null +++ b/src/utils/musicSdk/api-source-info.ts @@ -0,0 +1,29 @@ +// Support qualitys: 128k 320k flac wav + +const sources: Array<{ + id: string + name: string + disabled: boolean + supportQualitys: Partial> +}> = [ + { + 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