From d93fbd699d00bc28c55f1295f04f30ed442d81bf Mon Sep 17 00:00:00 2001 From: Folltoshe Date: Thu, 8 Jun 2023 09:50:16 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dwy=E6=BA=90=E7=83=AD?= =?UTF-8?q?=E6=90=9C=E8=AF=8D=20(#1403)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复wy源热搜词失效 * 添加更新日志 --------- Co-authored-by: lyswhut --- publish/changeLog.md | 1 + src/renderer/utils/musicSdk/wy/hotSearch.js | 18 ++++++------------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index de5fa76c..572ad326 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -16,6 +16,7 @@ - 修复播放某些在线音频会没有声音的问题 - 修复改变播放速率时会导致歌词报错的问题 - 修复tx热门评论昵称被错误切割的问题 (#1397, By: @helloplhm-qwq, @Folltoshe) +- 修复wy源热搜词失效的问题(#1401, @Folltoshe) - 修复Deepin 20下启用桌面歌词时可能会导致桌面卡死的问题(#1288) ### 其他 diff --git a/src/renderer/utils/musicSdk/wy/hotSearch.js b/src/renderer/utils/musicSdk/wy/hotSearch.js index 5ee4ffa4..ee1f9d20 100644 --- a/src/renderer/utils/musicSdk/wy/hotSearch.js +++ b/src/renderer/utils/musicSdk/wy/hotSearch.js @@ -1,5 +1,4 @@ -import { httpFetch } from '../../request' -import { weapi } from './utils/crypto' +import { eapiRequest } from './utils/index' export default { _requestObj: null, @@ -7,20 +6,15 @@ export default { if (this._requestObj) this._requestObj.cancelHttp() if (retryNum > 2) return Promise.reject(new Error('try max num')) - const _requestObj = httpFetch('https://music.163.com/weapi/search/hot', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: weapi({ type: 1111 }), + const _requestObj = eapiRequest('/api/search/chart/detail', { + id: 'HOT_SEARCH_SONG#@#', }) const { body, statusCode } = await _requestObj.promise if (statusCode != 200 || body.code !== 200) throw new Error('获取热搜词失败') - // console.log(body) - return { source: 'wy', list: this.filterList(body.result.hots) } + + return { source: 'wy', list: this.filterList(body.data.itemList) } }, filterList(rawList) { - return rawList.map(item => item.first) + return rawList.map(item => item.searchWord) }, } From 76981a59d473f1060e2190c6bc245a2f766dc62a Mon Sep 17 00:00:00 2001 From: lyswhut Date: Tue, 6 Jun 2023 12:20:29 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/defaultSetting.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/defaultSetting.ts b/src/common/defaultSetting.ts index 422ebb18..1a9f896b 100644 --- a/src/common/defaultSetting.ts +++ b/src/common/defaultSetting.ts @@ -75,7 +75,7 @@ const defaultSetting: LX.AppSetting = { 'desktopLyric.height': 300, 'desktopLyric.x': null, 'desktopLyric.y': null, - 'desktopLyric.isLockScreen': true, + 'desktopLyric.isLockScreen': isWin, 'desktopLyric.isDelayScroll': true, 'desktopLyric.scrollAlign': 'center', 'desktopLyric.isHoverHide': false, From b1a6c6b59c03ce537e677a866ad4b07f3440c1e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E7=8B=B8=E8=8A=B1=E5=96=B5?= Date: Fri, 9 Jun 2023 09:45:01 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0kg=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E6=8E=A5=E5=8F=A3(cmtlist->newest)=20&=20kg?= =?UTF-8?q?=E6=BA=90=E6=AD=8C=E6=89=8B=E7=9B=B8=E5=85=B3=20(#1405)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复wy源热搜词失效 * 更新kg最新评论接口(cmtlist->newest) & kg源歌手相关 --------- Co-authored-by: Folltoshe --- src/renderer/utils/musicSdk/kg/comment.js | 2 +- src/renderer/utils/musicSdk/kg/singer.js | 59 +++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 src/renderer/utils/musicSdk/kg/singer.js diff --git a/src/renderer/utils/musicSdk/kg/comment.js b/src/renderer/utils/musicSdk/kg/comment.js index 91f9fe0f..7d40ffe2 100644 --- a/src/renderer/utils/musicSdk/kg/comment.js +++ b/src/renderer/utils/musicSdk/kg/comment.js @@ -10,7 +10,7 @@ export default { let timestamp = Date.now() const params = `appid=1005&clienttime=${timestamp}&clienttoken=0&clientver=11409&code=fc4be23b4e972707f36b8a828a93ba8a&dfid=0&extdata=${hash}&kugouid=0&mid=16249512204336365674023395779019&mixsongid=0&p=${page}&pagesize=${limit}&uuid=0&ver=10` - const _requestObj = httpFetch(`http://m.comment.service.kugou.com/v1/cmtlist?${params}&signature=${signatureParams(params)}`, { + const _requestObj = httpFetch(`http://m.comment.service.kugou.com/r/v1/rank/newest?${params}&signature=${signatureParams(params)}`, { headers: { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.24', }, diff --git a/src/renderer/utils/musicSdk/kg/singer.js b/src/renderer/utils/musicSdk/kg/singer.js new file mode 100644 index 00000000..0109c4a3 --- /dev/null +++ b/src/renderer/utils/musicSdk/kg/singer.js @@ -0,0 +1,59 @@ +import { httpFetch } from '../../request' +// import { decodeName, formatPlayTime, sizeFormate } from '../../index' +// import { signatureParams } from './util' +import { getMusicInfosByList } from './musicInfo' + +export default { + filterAlbum(rawList) { + let returnList = [] + rawList.forEach((albumInfo) => { + returnList.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + }, + async getSingerInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480') + } + } + }, + async getSingerSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getSingerAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + } +} From 3f34fa26bf56c3a1426fd2020ba4c584f3d354dd Mon Sep 17 00:00:00 2001 From: lyswhut Date: Thu, 8 Jun 2023 13:05:25 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 206 +++++++++++++++++++++++----------------------- package.json | 10 +-- 2 files changed, 108 insertions(+), 108 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7843b150..645dad73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,8 +46,8 @@ "@types/better-sqlite3": "^7.6.4", "@types/needle": "^3.2.0", "@types/tunnel": "^0.0.3", - "@typescript-eslint/eslint-plugin": "^5.59.8", - "@typescript-eslint/parser": "^5.59.8", + "@typescript-eslint/eslint-plugin": "^5.59.9", + "@typescript-eslint/parser": "^5.59.9", "@volar/vue-language-plugin-pug": "^1.6.5", "babel-loader": "^9.1.2", "browserslist": "^4.21.7", @@ -63,7 +63,7 @@ "electron-builder": "^24.4.0", "electron-debug": "^3.2.0", "electron-devtools-installer": "^3.2.0", - "electron-to-chromium": "^1.4.419", + "electron-to-chromium": "^1.4.425", "electron-updater": "^6.1.0", "eslint": "^8.42.0", "eslint-config-standard": "^17.1.0", @@ -98,8 +98,8 @@ "vue-eslint-parser": "^9.3.0", "vue-loader": "^17.2.2", "vue-template-compiler": "^2.7.14", - "webpack": "^5.85.0", - "webpack-cli": "^5.1.2", + "webpack": "^5.86.0", + "webpack-cli": "^5.1.4", "webpack-dev-server": "^4.15.0", "webpack-hot-middleware": "github:lyswhut/webpack-hot-middleware#329c4375134b89d39da23a56a94db651247c74a1", "webpack-merge": "^5.9.0" @@ -3317,15 +3317,15 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.8.tgz", - "integrity": "sha512-JDMOmhXteJ4WVKOiHXGCoB96ADWg9q7efPWHRViT/f09bA8XOMLAVHHju3l0MkZnG1izaWXYmgvQcUjTRcpShQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.9.tgz", + "integrity": "sha512-4uQIBq1ffXd2YvF7MAvehWKW3zVv/w+mSfRAu+8cKbfj3nwzyqJLNcZJpQ/WZ1HLbJDiowwmQ6NO+63nCA+fqA==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.8", - "@typescript-eslint/type-utils": "5.59.8", - "@typescript-eslint/utils": "5.59.8", + "@typescript-eslint/scope-manager": "5.59.9", + "@typescript-eslint/type-utils": "5.59.9", + "@typescript-eslint/utils": "5.59.9", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", @@ -3384,14 +3384,14 @@ "dev": true }, "node_modules/@typescript-eslint/parser": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.8.tgz", - "integrity": "sha512-AnR19RjJcpjoeGojmwZtCwBX/RidqDZtzcbG3xHrmz0aHHoOcbWnpDllenRDmDvsV0RQ6+tbb09/kyc+UT9Orw==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.9.tgz", + "integrity": "sha512-FsPkRvBtcLQ/eVK1ivDiNYBjn3TGJdXy2fhXX+rc7czWl4ARwnpArwbihSOHI2Peg9WbtGHrbThfBUkZZGTtvQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.59.8", - "@typescript-eslint/types": "5.59.8", - "@typescript-eslint/typescript-estree": "5.59.8", + "@typescript-eslint/scope-manager": "5.59.9", + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/typescript-estree": "5.59.9", "debug": "^4.3.4" }, "engines": { @@ -3411,13 +3411,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.8.tgz", - "integrity": "sha512-/w08ndCYI8gxGf+9zKf1vtx/16y8MHrZs5/tnjHhMLNSixuNcJavSX4wAiPf4aS5x41Es9YPCn44MIe4cxIlig==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.9.tgz", + "integrity": "sha512-8RA+E+w78z1+2dzvK/tGZ2cpGigBZ58VMEHDZtpE1v+LLjzrYGc8mMaTONSxKyEkz3IuXFM0IqYiGHlCsmlZxQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.8", - "@typescript-eslint/visitor-keys": "5.59.8" + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/visitor-keys": "5.59.9" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -3428,13 +3428,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.8.tgz", - "integrity": "sha512-+5M518uEIHFBy3FnyqZUF3BMP+AXnYn4oyH8RF012+e7/msMY98FhGL5SrN29NQ9xDgvqCgYnsOiKp1VjZ/fpA==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.9.tgz", + "integrity": "sha512-ksEsT0/mEHg9e3qZu98AlSrONAQtrSTljL3ow9CGej8eRo7pe+yaC/mvTjptp23Xo/xIf2mLZKC6KPv4Sji26Q==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.59.8", - "@typescript-eslint/utils": "5.59.8", + "@typescript-eslint/typescript-estree": "5.59.9", + "@typescript-eslint/utils": "5.59.9", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -3455,9 +3455,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.8.tgz", - "integrity": "sha512-+uWuOhBTj/L6awoWIg0BlWy0u9TyFpCHrAuQ5bNfxDaZ1Ppb3mx6tUigc74LHcbHpOHuOTOJrBoAnhdHdaea1w==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.9.tgz", + "integrity": "sha512-uW8H5NRgTVneSVTfiCVffBb8AbwWSKg7qcA4Ot3JI3MPCJGsB4Db4BhvAODIIYE5mNj7Q+VJkK7JxmRhk2Lyjw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -3468,13 +3468,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.8.tgz", - "integrity": "sha512-Jy/lPSDJGNow14vYu6IrW790p7HIf/SOV1Bb6lZ7NUkLc2iB2Z9elESmsaUtLw8kVqogSbtLH9tut5GCX1RLDg==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.9.tgz", + "integrity": "sha512-pmM0/VQ7kUhd1QyIxgS+aRvMgw+ZljB3eDb+jYyp6d2bC0mQWLzUDF+DLwCTkQ3tlNyVsvZRXjFyV0LkU/aXjA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.8", - "@typescript-eslint/visitor-keys": "5.59.8", + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/visitor-keys": "5.59.9", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -3528,17 +3528,17 @@ "dev": true }, "node_modules/@typescript-eslint/utils": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.8.tgz", - "integrity": "sha512-Tr65630KysnNn9f9G7ROF3w1b5/7f6QVCJ+WK9nhIocWmx9F+TmCAcglF26Vm7z8KCTwoKcNEBZrhlklla3CKg==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.9.tgz", + "integrity": "sha512-1PuMYsju/38I5Ggblaeb98TOoUvjhRvLpLa1DoTOFaLWqaXl/1iQ1eGurTXgBY58NUdtfTXKP5xBq7q9NDaLKg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.8", - "@typescript-eslint/types": "5.59.8", - "@typescript-eslint/typescript-estree": "5.59.8", + "@typescript-eslint/scope-manager": "5.59.9", + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/typescript-estree": "5.59.9", "eslint-scope": "^5.1.1", "semver": "^7.3.7" }, @@ -3587,12 +3587,12 @@ "dev": true }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.8.tgz", - "integrity": "sha512-pJhi2ms0x0xgloT7xYabil3SGGlojNNKjK/q6dB3Ey0uJLMjK2UDGJvHieiyJVW/7C3KI+Z4Q3pEHkm4ejA+xQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.9.tgz", + "integrity": "sha512-bT7s0td97KMaLwpEBckbzj/YohnvXtqbe2XgqNvTl6RJVakY5mvENOTPvw5u66nljfZxthESpDozs86U+oLY8Q==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/types": "5.59.9", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -7543,9 +7543,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.419", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.419.tgz", - "integrity": "sha512-jdie3RiEgygvDTyS2sgjq71B36q2cDSBfPlwzUyuOrfYTNoYWyBxxjGJV/HAu3A2hB0Y+HesvCVkVAFoCKwCSw==", + "version": "1.4.425", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.425.tgz", + "integrity": "sha512-wv1NufHxu11zfDbY4fglYQApMswleE9FL/DSeyOyauVXDZ+Kco96JK/tPfBUaDqfRarYp2WH2hJ/5UnVywp9Jg==", "dev": true }, "node_modules/electron-updater": { @@ -17974,9 +17974,9 @@ } }, "node_modules/webpack": { - "version": "5.85.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.85.0.tgz", - "integrity": "sha512-7gazTiYqwo5OSqwH1tigLDL2r3qDeP2dOKYgd+LlXpsUMqDTklg6tOghexqky0/+6QY38kb/R/uRPUleuL43zg==", + "version": "5.86.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.86.0.tgz", + "integrity": "sha512-3BOvworZ8SO/D4GVP+GoRC3fVeg5MO4vzmq8TJJEkdmopxyazGDxN8ClqN12uzrZW9Tv8EED8v5VSb6Sqyi0pg==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", @@ -18021,9 +18021,9 @@ } }, "node_modules/webpack-cli": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.2.tgz", - "integrity": "sha512-RI4KfVpjX1qdy5Sq4A1ycCxgTZ2rLLtrTJDBYh3A3DpSSDZ+WP4oBlj/CuD70oXz4wB1WqVjg+lMxH/MPYWb5g==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz", + "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==", "dev": true, "dependencies": { "@discoveryjs/json-ext": "^0.5.0", @@ -20873,15 +20873,15 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.8.tgz", - "integrity": "sha512-JDMOmhXteJ4WVKOiHXGCoB96ADWg9q7efPWHRViT/f09bA8XOMLAVHHju3l0MkZnG1izaWXYmgvQcUjTRcpShQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.9.tgz", + "integrity": "sha512-4uQIBq1ffXd2YvF7MAvehWKW3zVv/w+mSfRAu+8cKbfj3nwzyqJLNcZJpQ/WZ1HLbJDiowwmQ6NO+63nCA+fqA==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.8", - "@typescript-eslint/type-utils": "5.59.8", - "@typescript-eslint/utils": "5.59.8", + "@typescript-eslint/scope-manager": "5.59.9", + "@typescript-eslint/type-utils": "5.59.9", + "@typescript-eslint/utils": "5.59.9", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", @@ -20917,53 +20917,53 @@ } }, "@typescript-eslint/parser": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.8.tgz", - "integrity": "sha512-AnR19RjJcpjoeGojmwZtCwBX/RidqDZtzcbG3xHrmz0aHHoOcbWnpDllenRDmDvsV0RQ6+tbb09/kyc+UT9Orw==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.9.tgz", + "integrity": "sha512-FsPkRvBtcLQ/eVK1ivDiNYBjn3TGJdXy2fhXX+rc7czWl4ARwnpArwbihSOHI2Peg9WbtGHrbThfBUkZZGTtvQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.59.8", - "@typescript-eslint/types": "5.59.8", - "@typescript-eslint/typescript-estree": "5.59.8", + "@typescript-eslint/scope-manager": "5.59.9", + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/typescript-estree": "5.59.9", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.8.tgz", - "integrity": "sha512-/w08ndCYI8gxGf+9zKf1vtx/16y8MHrZs5/tnjHhMLNSixuNcJavSX4wAiPf4aS5x41Es9YPCn44MIe4cxIlig==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.9.tgz", + "integrity": "sha512-8RA+E+w78z1+2dzvK/tGZ2cpGigBZ58VMEHDZtpE1v+LLjzrYGc8mMaTONSxKyEkz3IuXFM0IqYiGHlCsmlZxQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.8", - "@typescript-eslint/visitor-keys": "5.59.8" + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/visitor-keys": "5.59.9" } }, "@typescript-eslint/type-utils": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.8.tgz", - "integrity": "sha512-+5M518uEIHFBy3FnyqZUF3BMP+AXnYn4oyH8RF012+e7/msMY98FhGL5SrN29NQ9xDgvqCgYnsOiKp1VjZ/fpA==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.9.tgz", + "integrity": "sha512-ksEsT0/mEHg9e3qZu98AlSrONAQtrSTljL3ow9CGej8eRo7pe+yaC/mvTjptp23Xo/xIf2mLZKC6KPv4Sji26Q==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.59.8", - "@typescript-eslint/utils": "5.59.8", + "@typescript-eslint/typescript-estree": "5.59.9", + "@typescript-eslint/utils": "5.59.9", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.8.tgz", - "integrity": "sha512-+uWuOhBTj/L6awoWIg0BlWy0u9TyFpCHrAuQ5bNfxDaZ1Ppb3mx6tUigc74LHcbHpOHuOTOJrBoAnhdHdaea1w==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.9.tgz", + "integrity": "sha512-uW8H5NRgTVneSVTfiCVffBb8AbwWSKg7qcA4Ot3JI3MPCJGsB4Db4BhvAODIIYE5mNj7Q+VJkK7JxmRhk2Lyjw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.8.tgz", - "integrity": "sha512-Jy/lPSDJGNow14vYu6IrW790p7HIf/SOV1Bb6lZ7NUkLc2iB2Z9elESmsaUtLw8kVqogSbtLH9tut5GCX1RLDg==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.9.tgz", + "integrity": "sha512-pmM0/VQ7kUhd1QyIxgS+aRvMgw+ZljB3eDb+jYyp6d2bC0mQWLzUDF+DLwCTkQ3tlNyVsvZRXjFyV0LkU/aXjA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.8", - "@typescript-eslint/visitor-keys": "5.59.8", + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/visitor-keys": "5.59.9", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -20998,17 +20998,17 @@ } }, "@typescript-eslint/utils": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.8.tgz", - "integrity": "sha512-Tr65630KysnNn9f9G7ROF3w1b5/7f6QVCJ+WK9nhIocWmx9F+TmCAcglF26Vm7z8KCTwoKcNEBZrhlklla3CKg==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.9.tgz", + "integrity": "sha512-1PuMYsju/38I5Ggblaeb98TOoUvjhRvLpLa1DoTOFaLWqaXl/1iQ1eGurTXgBY58NUdtfTXKP5xBq7q9NDaLKg==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.8", - "@typescript-eslint/types": "5.59.8", - "@typescript-eslint/typescript-estree": "5.59.8", + "@typescript-eslint/scope-manager": "5.59.9", + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/typescript-estree": "5.59.9", "eslint-scope": "^5.1.1", "semver": "^7.3.7" }, @@ -21040,12 +21040,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "5.59.8", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.8.tgz", - "integrity": "sha512-pJhi2ms0x0xgloT7xYabil3SGGlojNNKjK/q6dB3Ey0uJLMjK2UDGJvHieiyJVW/7C3KI+Z4Q3pEHkm4ejA+xQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.9.tgz", + "integrity": "sha512-bT7s0td97KMaLwpEBckbzj/YohnvXtqbe2XgqNvTl6RJVakY5mvENOTPvw5u66nljfZxthESpDozs86U+oLY8Q==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/types": "5.59.9", "eslint-visitor-keys": "^3.3.0" }, "dependencies": { @@ -24106,9 +24106,9 @@ } }, "electron-to-chromium": { - "version": "1.4.419", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.419.tgz", - "integrity": "sha512-jdie3RiEgygvDTyS2sgjq71B36q2cDSBfPlwzUyuOrfYTNoYWyBxxjGJV/HAu3A2hB0Y+HesvCVkVAFoCKwCSw==", + "version": "1.4.425", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.425.tgz", + "integrity": "sha512-wv1NufHxu11zfDbY4fglYQApMswleE9FL/DSeyOyauVXDZ+Kco96JK/tPfBUaDqfRarYp2WH2hJ/5UnVywp9Jg==", "dev": true }, "electron-updater": { @@ -32045,9 +32045,9 @@ } }, "webpack": { - "version": "5.85.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.85.0.tgz", - "integrity": "sha512-7gazTiYqwo5OSqwH1tigLDL2r3qDeP2dOKYgd+LlXpsUMqDTklg6tOghexqky0/+6QY38kb/R/uRPUleuL43zg==", + "version": "5.86.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.86.0.tgz", + "integrity": "sha512-3BOvworZ8SO/D4GVP+GoRC3fVeg5MO4vzmq8TJJEkdmopxyazGDxN8ClqN12uzrZW9Tv8EED8v5VSb6Sqyi0pg==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.3", @@ -32090,9 +32090,9 @@ } }, "webpack-cli": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.2.tgz", - "integrity": "sha512-RI4KfVpjX1qdy5Sq4A1ycCxgTZ2rLLtrTJDBYh3A3DpSSDZ+WP4oBlj/CuD70oXz4wB1WqVjg+lMxH/MPYWb5g==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz", + "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==", "dev": true, "requires": { "@discoveryjs/json-ext": "^0.5.0", diff --git a/package.json b/package.json index 1b38886f..778bc45b 100644 --- a/package.json +++ b/package.json @@ -220,8 +220,8 @@ "@types/better-sqlite3": "^7.6.4", "@types/needle": "^3.2.0", "@types/tunnel": "^0.0.3", - "@typescript-eslint/eslint-plugin": "^5.59.8", - "@typescript-eslint/parser": "^5.59.8", + "@typescript-eslint/eslint-plugin": "^5.59.9", + "@typescript-eslint/parser": "^5.59.9", "@volar/vue-language-plugin-pug": "^1.6.5", "babel-loader": "^9.1.2", "browserslist": "^4.21.7", @@ -237,7 +237,7 @@ "electron-builder": "^24.4.0", "electron-debug": "^3.2.0", "electron-devtools-installer": "^3.2.0", - "electron-to-chromium": "^1.4.419", + "electron-to-chromium": "^1.4.425", "electron-updater": "^6.1.0", "eslint": "^8.42.0", "eslint-config-standard": "^17.1.0", @@ -272,8 +272,8 @@ "vue-eslint-parser": "^9.3.0", "vue-loader": "^17.2.2", "vue-template-compiler": "^2.7.14", - "webpack": "^5.85.0", - "webpack-cli": "^5.1.2", + "webpack": "^5.86.0", + "webpack-cli": "^5.1.4", "webpack-dev-server": "^4.15.0", "webpack-hot-middleware": "github:lyswhut/webpack-hot-middleware#329c4375134b89d39da23a56a94db651247c74a1", "webpack-merge": "^5.9.0" From 6403b8ce3873b739af981174fd7fc935aa4c49b6 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Fri, 9 Jun 2023 09:55:54 +0800 Subject: [PATCH 5/7] code lint --- src/renderer/utils/musicSdk/kg/singer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/utils/musicSdk/kg/singer.js b/src/renderer/utils/musicSdk/kg/singer.js index 0109c4a3..b2f9394e 100644 --- a/src/renderer/utils/musicSdk/kg/singer.js +++ b/src/renderer/utils/musicSdk/kg/singer.js @@ -26,8 +26,8 @@ export default { info: { name: body.data.singername, desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480') - } + img: body.data.imgurl.replace('{size}', '480'), + }, } }, async getSingerSongList(singerid, page, limit) { @@ -55,5 +55,5 @@ export default { albums: this.filterAlbum(body.data.info), singerid, } - } + }, } From 0f5fa7f715c31cd20a04851d4a1d40871951e9e3 Mon Sep 17 00:00:00 2001 From: Folltoshe Date: Fri, 9 Jun 2023 23:52:22 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=AD=8C=E6=89=8BAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../musicSdk/kg/singer_20230609203128.js | 59 +++++++ .../musicSdk/kg/singer_20230609230828.js | 60 +++++++ .../musicSdk/kg/singer_20230609230857.js | 58 +++++++ .../musicSdk/kg/singer_20230609230914.js | 58 +++++++ .../musicSdk/kg/singer_20230609230921.js | 59 +++++++ .../musicSdk/kg/singer_20230609230937.js | 59 +++++++ .../musicSdk/kg/singer_20230609230943.js | 60 +++++++ .../musicSdk/kg/singer_20230609230950.js | 62 ++++++++ .../musicSdk/kg/singer_20230609230955.js | 62 ++++++++ .../musicSdk/kg/singer_20230609231029.js | 63 ++++++++ .../musicSdk/kg/singer_20230609231127.js | 67 ++++++++ .../musicSdk/kg/singer_20230609231135.js | 70 ++++++++ .../musicSdk/kg/singer_20230609231520.js | 80 ++++++++++ .../musicSdk/kg/singer_20230609231538.js | 80 ++++++++++ .../musicSdk/kg/singer_20230609231555.js | 80 ++++++++++ .../musicSdk/kg/singer_20230609231558.js | 80 ++++++++++ .../musicSdk/kg/singer_20230609231618.js | 80 ++++++++++ .../musicSdk/kg/singer_20230609231649.js | 80 ++++++++++ .../musicSdk/kg/singer_20230609231657.js | 80 ++++++++++ .../musicSdk/kg/singer_20230609231707.js | 81 ++++++++++ .../musicSdk/kg/singer_20230609231721.js | 68 ++++++++ .../musicSdk/kg/singer_20230609231724.js | 67 ++++++++ .../musicSdk/kg/singer_20230609232058.js | 67 ++++++++ .../musicSdk/kg/singer_20230609232241.js | 71 +++++++++ .../musicSdk/kg/singer_20230609232451.js | 70 ++++++++ .../musicSdk/kg/singer_20230609232500.js | 67 ++++++++ .../musicSdk/kg/singer_20230609232526.js | 68 ++++++++ .../musicSdk/kg/singer_20230609232530.js | 69 ++++++++ .../musicSdk/kg/singer_20230609232532.js | 69 ++++++++ .../musicSdk/kg/singer_20230609232535.js | 67 ++++++++ .../musicSdk/kg/singer_20230609232556.js | 67 ++++++++ .../musicSdk/kg/singer_20230609232738.js | 66 ++++++++ .../musicSdk/kg/singer_20230609232741.js | 65 ++++++++ .../musicSdk/kg/singer_20230609232752.js | 66 ++++++++ .../musicSdk/kg/singer_20230609232804.js | 66 ++++++++ .../musicSdk/kg/singer_20230609233005.js | 65 ++++++++ .../musicSdk/kg/singer_20230609233020.js | 67 ++++++++ .../musicSdk/kg/singer_20230609233027.js | 67 ++++++++ .../musicSdk/kg/singer_20230609233257.js | 67 ++++++++ .../musicSdk/kg/singer_20230609233415.js | 71 +++++++++ .../musicSdk/kg/singer_20230609233553.js | 71 +++++++++ .../musicSdk/kg/singer_20230609233623.js | 71 +++++++++ .../musicSdk/kg/singer_20230609234004.js | 73 +++++++++ .../musicSdk/kg/singer_20230609234010.js | 74 +++++++++ .../musicSdk/kg/singer_20230609234014.js | 65 ++++++++ .../musicSdk/kg/singer_20230609234022.js | 62 ++++++++ .../musicSdk/kg/singer_20230609234034.js | 63 ++++++++ .../musicSdk/kg/singer_20230609234146.js | 63 ++++++++ .../musicSdk/kg/singer_20230609234208.js | 66 ++++++++ .../musicSdk/kg/singer_20230609234242.js | 65 ++++++++ .../musicSdk/kg/singer_20230609234304.js | 66 ++++++++ .../musicSdk/kg/singer_20230609234309.js | 66 ++++++++ .../musicSdk/kg/singer_20230609234337.js | 67 ++++++++ .../musicSdk/kg/singer_20230609234401.js | 65 ++++++++ .../musicSdk/kg/singer_20230609234433.js | 71 +++++++++ .../musicSdk/kg/singer_20230609234447.js | 71 +++++++++ .../musicSdk/kg/singer_20230609234507.js | 71 +++++++++ .../musicSdk/kg/singer_20230609234515.js | 71 +++++++++ .../musicSdk/kg/singer_20230609234527.js | 70 ++++++++ .../musicSdk/kg/singer_20230609234802.js | 74 +++++++++ .../musicSdk/kg/singer_20230609234808.js | 74 +++++++++ .../musicSdk/kg/singer_20230609234837.js | 74 +++++++++ .../musicSdk/kg/singer_20230609234843.js | 74 +++++++++ .../musicSdk/kg/singer_20230609234902.js | 80 ++++++++++ .../musicSdk/kg/singer_20230609234910.js | 80 ++++++++++ .../musicSdk/kg/singer_20230609234918.js | 80 ++++++++++ .../musicSdk/kg/singer_20230609234940.js | 86 ++++++++++ .../musicSdk/wy/singer_20230609212734.js | 0 .../musicSdk/wy/singer_20230609212744.js | 3 + .../musicSdk/wy/singer_20230609212850.js | 5 + .../musicSdk/wy/singer_20230609212930.js | 8 + .../musicSdk/wy/singer_20230609212933.js | 7 + .../musicSdk/wy/singer_20230609213030.js | 7 + .../musicSdk/wy/singer_20230609213037.js | 8 + .../musicSdk/wy/singer_20230609213052.js | 8 + .../musicSdk/wy/singer_20230609213055.js | 6 + .../musicSdk/wy/singer_20230609213434.js | 9 ++ .../musicSdk/wy/singer_20230609213452.js | 9 ++ .../musicSdk/wy/singer_20230609213501.js | 11 ++ .../musicSdk/wy/singer_20230609214136.js | 11 ++ .../musicSdk/wy/singer_20230609214159.js | 11 ++ .../musicSdk/wy/singer_20230609214211.js | 9 ++ .../musicSdk/wy/singer_20230609214218.js | 8 + .../musicSdk/wy/singer_20230609214941.js | 14 ++ .../musicSdk/wy/singer_20230609215009.js | 14 ++ .../musicSdk/wy/singer_20230609215649.js | 14 ++ .../musicSdk/wy/singer_20230609215657.js | 14 ++ .../musicSdk/wy/singer_20230609215709.js | 14 ++ .../musicSdk/wy/singer_20230609215719.js | 16 ++ .../musicSdk/wy/singer_20230609215845.js | 19 +++ .../musicSdk/wy/singer_20230609220016.js | 20 +++ .../musicSdk/wy/singer_20230609220055.js | 21 +++ .../musicSdk/wy/singer_20230609220127.js | 22 +++ .../musicSdk/wy/singer_20230609220527.js | 23 +++ .../musicSdk/wy/singer_20230609220534.js | 24 +++ .../musicSdk/wy/singer_20230609220545.js | 23 +++ .../musicSdk/wy/singer_20230609220605.js | 23 +++ .../musicSdk/wy/singer_20230609220615.js | 24 +++ .../musicSdk/wy/singer_20230609221125.js | 25 +++ .../musicSdk/wy/singer_20230609221155.js | 27 ++++ .../musicSdk/wy/singer_20230609221158.js | 26 +++ .../musicSdk/wy/singer_20230609221240.js | 26 +++ .../musicSdk/wy/singer_20230609221248.js | 26 +++ .../musicSdk/wy/singer_20230609221303.js | 26 +++ .../musicSdk/wy/singer_20230609221314.js | 26 +++ .../musicSdk/wy/singer_20230609221326.js | 26 +++ .../musicSdk/wy/singer_20230609221419.js | 26 +++ .../musicSdk/wy/singer_20230609221422.js | 26 +++ .../musicSdk/wy/singer_20230609221436.js | 26 +++ .../musicSdk/wy/singer_20230609221847.js | 29 ++++ .../musicSdk/wy/singer_20230609221916.js | 35 ++++ .../musicSdk/wy/singer_20230609221957.js | 36 +++++ .../musicSdk/wy/singer_20230609222018.js | 37 +++++ .../musicSdk/wy/singer_20230609222227.js | 41 +++++ .../musicSdk/wy/singer_20230609222449.js | 41 +++++ .../musicSdk/wy/singer_20230609222504.js | 42 +++++ .../musicSdk/wy/singer_20230609222523.js | 43 +++++ .../musicSdk/wy/singer_20230609222543.js | 43 +++++ .../musicSdk/wy/singer_20230609222828.js | 48 ++++++ .../musicSdk/wy/singer_20230609222834.js | 48 ++++++ .../musicSdk/wy/singer_20230609222837.js | 48 ++++++ .../musicSdk/wy/singer_20230609223044.js | 48 ++++++ .../musicSdk/wy/singer_20230609223335.js | 50 ++++++ .../musicSdk/wy/singer_20230609223338.js | 48 ++++++ .../musicSdk/wy/singer_20230609223350.js | 49 ++++++ .../musicSdk/wy/singer_20230609223400.js | 50 ++++++ .../musicSdk/wy/singer_20230609223403.js | 49 ++++++ .../musicSdk/wy/singer_20230609223442.js | 50 ++++++ .../musicSdk/wy/singer_20230609223446.js | 50 ++++++ .../musicSdk/wy/singer_20230609223552.js | 66 ++++++++ .../musicSdk/wy/singer_20230609223554.js | 66 ++++++++ .../musicSdk/wy/singer_20230609223604.js | 67 ++++++++ .../musicSdk/wy/singer_20230609223619.js | 68 ++++++++ .../musicSdk/wy/singer_20230609223622.js | 68 ++++++++ .../musicSdk/wy/singer_20230609223634.js | 69 ++++++++ .../musicSdk/wy/singer_20230609223639.js | 70 ++++++++ .../musicSdk/wy/singer_20230609223641.js | 70 ++++++++ .../musicSdk/wy/singer_20230609223656.js | 71 +++++++++ .../musicSdk/wy/singer_20230609223733.js | 76 +++++++++ .../musicSdk/wy/singer_20230609223747.js | 77 +++++++++ .../musicSdk/wy/singer_20230609223753.js | 78 +++++++++ .../musicSdk/wy/singer_20230609223816.js | 94 +++++++++++ .../musicSdk/wy/singer_20230609223823.js | 93 +++++++++++ .../musicSdk/wy/singer_20230609223827.js | 92 +++++++++++ .../musicSdk/wy/singer_20230609224031.js | 98 ++++++++++++ .../musicSdk/wy/singer_20230609224036.js | 98 ++++++++++++ .../musicSdk/wy/singer_20230609224056.js | 98 ++++++++++++ .../musicSdk/wy/singer_20230609224110.js | 98 ++++++++++++ .../musicSdk/wy/singer_20230609224136.js | 98 ++++++++++++ .../musicSdk/wy/singer_20230609224159.js | 98 ++++++++++++ .../musicSdk/wy/singer_20230609224216.js | 98 ++++++++++++ .../musicSdk/wy/singer_20230609224229.js | 98 ++++++++++++ .../musicSdk/wy/singer_20230609224359.js | 98 ++++++++++++ .../musicSdk/wy/singer_20230609224416.js | 98 ++++++++++++ .../musicSdk/wy/singer_20230609224418.js | 98 ++++++++++++ .../musicSdk/wy/singer_20230609224432.js | 98 ++++++++++++ .../musicSdk/wy/singer_20230609224457.js | 99 ++++++++++++ .../musicSdk/wy/singer_20230609224519.js | 99 ++++++++++++ .../musicSdk/wy/singer_20230609224547.js | 99 ++++++++++++ .../musicSdk/wy/singer_20230609224621.js | 99 ++++++++++++ .../musicSdk/wy/singer_20230609224651.js | 99 ++++++++++++ .../musicSdk/wy/singer_20230609224705.js | 99 ++++++++++++ .../musicSdk/wy/singer_20230609224959.js | 100 ++++++++++++ .../musicSdk/wy/singer_20230609225008.js | 100 ++++++++++++ .../musicSdk/wy/singer_20230609225015.js | 100 ++++++++++++ .../musicSdk/wy/singer_20230609225029.js | 99 ++++++++++++ .../musicSdk/wy/singer_20230609225557.js | 99 ++++++++++++ .../musicSdk/wy/singer_20230609225623.js | 99 ++++++++++++ .../musicSdk/wy/singer_20230609225628.js | 99 ++++++++++++ .../musicSdk/wy/singer_20230609225739.js | 102 ++++++++++++ .../musicSdk/wy/singer_20230609225749.js | 102 ++++++++++++ .../musicSdk/wy/singer_20230609225803.js | 108 +++++++++++++ .../musicSdk/wy/singer_20230609225956.js | 116 ++++++++++++++ .../musicSdk/wy/singer_20230609230028.js | 115 ++++++++++++++ .../musicSdk/wy/singer_20230609230036.js | 115 ++++++++++++++ .../musicSdk/wy/singer_20230609230053.js | 115 ++++++++++++++ .../musicSdk/wy/singer_20230609230116.js | 115 ++++++++++++++ .../musicSdk/wy/singer_20230609230133.js | 118 ++++++++++++++ .../musicSdk/wy/singer_20230609230135.js | 118 ++++++++++++++ .../musicSdk/wy/singer_20230609230201.js | 122 ++++++++++++++ .../musicSdk/wy/singer_20230609230241.js | 122 ++++++++++++++ .../musicSdk/wy/singer_20230609230313.js | 124 +++++++++++++++ .../musicSdk/wy/singer_20230609230317.js | 122 ++++++++++++++ .../musicSdk/wy/singer_20230609230344.js | 129 +++++++++++++++ .../musicSdk/wy/singer_20230609230357.js | 130 +++++++++++++++ .../musicSdk/wy/singer_20230609230431.js | 131 +++++++++++++++ .../musicSdk/wy/singer_20230609230456.js | 132 ++++++++++++++++ .../musicSdk/wy/singer_20230609230656.js | 132 ++++++++++++++++ .../musicSdk/wy/singer_20230609230702.js | 131 +++++++++++++++ .../musicSdk/wy/singer_20230609230727.js | 132 ++++++++++++++++ .../musicSdk/wy/singer_20230609230734.js | 132 ++++++++++++++++ .../musicSdk/wy/singer_20230609232004.js | 133 ++++++++++++++++ .../musicSdk/wy/singer_20230609232819.js | 135 ++++++++++++++++ .../musicSdk/wy/singer_20230609232854.js | 141 +++++++++++++++++ .../musicSdk/wy/singer_20230609232950.js | 141 +++++++++++++++++ .../musicSdk/wy/singer_20230609232952.js | 141 +++++++++++++++++ .../musicSdk/wy/singer_20230609234543.js | 143 +++++++++++++++++ .../musicSdk/wy/singer_20230609234610.js | 148 +++++++++++++++++ .../musicSdk/wy/singer_20230609234742.js | 149 ++++++++++++++++++ .../musicSdk/wy/utils/index_20230521134626.js | 22 +++ .../musicSdk/wy/utils/index_20230609213722.js | 49 ++++++ .../musicSdk/wy/utils/index_20230609213741.js | 48 ++++++ .../musicSdk/wy/utils/index_20230609213807.js | 43 +++++ .../musicSdk/wy/utils/index_20230609213814.js | 43 +++++ .../musicSdk/wy/utils/index_20230609213832.js | 42 +++++ .../musicSdk/wy/utils/index_20230609214124.js | 22 +++ .../musicSdk/wy/utils/index_20230609215059.js | 49 ++++++ .../musicSdk/wy/utils/index_20230609215140.js | 49 ++++++ .../musicSdk/wy/utils/index_20230609215240.js | 50 ++++++ .../musicSdk/wy/utils/index_20230609215413.js | 63 ++++++++ .../musicSdk/wy/utils/index_20230609215428.js | 63 ++++++++ .../musicSdk/wy/utils/index_20230609215435.js | 62 ++++++++ .../musicSdk/wy/utils/index_20230609215438.js | 61 +++++++ .../musicSdk/wy/utils/index_20230609215445.js | 61 +++++++ .../musicSdk/wy/utils/index_20230609215451.js | 61 +++++++ .../musicSdk/wy/utils/index_20230609215506.js | 61 +++++++ .../musicSdk/wy/utils/index_20230609215510.js | 62 ++++++++ .../musicSdk/wy/utils/index_20230609215513.js | 62 ++++++++ .../musicSdk/wy/utils/index_20230609215535.js | 57 +++++++ .../musicSdk/wy/utils/index_20230609215546.js | 57 +++++++ .../musicSdk/wy/utils/index_20230609215557.js | 56 +++++++ .../musicSdk/wy/utils/index_20230609215601.js | 56 +++++++ .../musicSdk/wy/utils/index_20230609215616.js | 56 +++++++ .../musicSdk/wy/utils/index_20230609215628.js | 56 +++++++ .../musicSdk/wy/utils/index_20230609215641.js | 56 +++++++ .../musicSdk/wy/utils/index_20230609224836.js | 64 ++++++++ .../musicSdk/wy/utils/index_20230609224839.js | 64 ++++++++ .../musicSdk/wy/utils/index_20230609224855.js | 56 +++++++ src/renderer/utils/musicSdk/kg/singer.js | 123 +++++++++------ src/renderer/utils/musicSdk/wy/singer.js | 149 ++++++++++++++++++ src/renderer/utils/musicSdk/wy/utils/index.js | 34 ++++ 231 files changed, 15411 insertions(+), 48 deletions(-) create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609203128.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230828.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230857.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230914.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230921.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230937.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230943.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230950.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230955.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231029.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231127.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231135.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231520.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231538.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231555.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231558.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231618.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231649.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231657.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231707.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231721.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231724.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232058.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232241.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232451.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232500.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232526.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232530.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232532.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232535.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232556.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232738.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232741.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232752.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232804.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609233005.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609233020.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609233027.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609233257.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609233415.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609233553.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609233623.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234004.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234010.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234014.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234022.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234034.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234146.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234208.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234242.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234304.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234309.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234337.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234401.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234433.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234447.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234507.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234515.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234527.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234802.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234808.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234837.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234843.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234902.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234910.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234918.js create mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234940.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609212734.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609212744.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609212850.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609212930.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609212933.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609213030.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609213037.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609213052.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609213055.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609213434.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609213452.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609213501.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609214136.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609214159.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609214211.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609214218.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609214941.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609215009.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609215649.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609215657.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609215709.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609215719.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609215845.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220016.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220055.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220127.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220527.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220534.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220545.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220605.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220615.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221125.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221155.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221158.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221240.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221248.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221303.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221314.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221326.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221419.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221422.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221436.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221847.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221916.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221957.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222018.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222227.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222449.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222504.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222523.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222543.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222828.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222834.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222837.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223044.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223335.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223338.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223350.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223400.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223403.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223442.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223446.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223552.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223554.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223604.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223619.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223622.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223634.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223639.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223641.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223656.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223733.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223747.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223753.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223816.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223823.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223827.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224031.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224036.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224056.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224110.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224136.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224159.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224216.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224229.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224359.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224416.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224418.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224432.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224457.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224519.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224547.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224621.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224651.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224705.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224959.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225008.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225015.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225029.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225557.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225623.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225628.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225739.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225749.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225803.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225956.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230028.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230036.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230053.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230116.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230133.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230135.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230201.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230241.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230313.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230317.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230344.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230357.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230431.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230456.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230656.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230702.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230727.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230734.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609232004.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609232819.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609232854.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609232950.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609232952.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609234543.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609234610.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609234742.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230521134626.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609213722.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609213741.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609213807.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609213814.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609213832.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609214124.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215059.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215140.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215240.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215413.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215428.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215435.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215438.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215445.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215451.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215506.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215510.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215513.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215535.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215546.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215557.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215601.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215616.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215628.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215641.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609224836.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609224839.js create mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609224855.js create mode 100644 src/renderer/utils/musicSdk/wy/singer.js diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609203128.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609203128.js new file mode 100644 index 00000000..b2f9394e --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609203128.js @@ -0,0 +1,59 @@ +import { httpFetch } from '../../request' +// import { decodeName, formatPlayTime, sizeFormate } from '../../index' +// import { signatureParams } from './util' +import { getMusicInfosByList } from './musicInfo' + +export default { + filterAlbum(rawList) { + let returnList = [] + rawList.forEach((albumInfo) => { + returnList.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + }, + async getSingerInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSingerSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getSingerAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, +} diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230828.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230828.js new file mode 100644 index 00000000..3c4df863 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230828.js @@ -0,0 +1,60 @@ +import { httpFetch } from '../../request' +// import { decodeName, formatPlayTime, sizeFormate } from '../../index' +// import { signatureParams } from './util' +import { getMusicInfosByList } from './musicInfo' + +export default { + filterAlbum(rawList) { + const list = [] + rawList.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, + async getSingerInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSingerSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getSingerAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, +} diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230857.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230857.js new file mode 100644 index 00000000..caef18a2 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230857.js @@ -0,0 +1,58 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' + +export default { + filterAlbum(rawList) { + const list = [] + rawList.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, + async getSingerInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSingerSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getSingerAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, +} diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230914.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230914.js new file mode 100644 index 00000000..20366d54 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230914.js @@ -0,0 +1,58 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' + +export default { + async getSingerInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSingerSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getSingerAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(rawList) { + const list = [] + rawList.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230921.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230921.js new file mode 100644 index 00000000..91aa69e0 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230921.js @@ -0,0 +1,59 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' + +export default { + async getSingerInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSingerSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getSingerAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230937.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230937.js new file mode 100644 index 00000000..2376dc3f --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230937.js @@ -0,0 +1,59 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' + +export default { + async getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230943.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230943.js new file mode 100644 index 00000000..af3773cc --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230943.js @@ -0,0 +1,60 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' + +export default { + async getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230950.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230950.js new file mode 100644 index 00000000..2c37ecc8 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230950.js @@ -0,0 +1,62 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' + +export default { + async getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230955.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230955.js new file mode 100644 index 00000000..2c37ecc8 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230955.js @@ -0,0 +1,62 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' + +export default { + async getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231029.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231029.js new file mode 100644 index 00000000..01690e11 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231029.js @@ -0,0 +1,63 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + async getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231127.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231127.js new file mode 100644 index 00000000..2a193689 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231127.js @@ -0,0 +1,67 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + async getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231135.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231135.js new file mode 100644 index 00000000..32932a27 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231135.js @@ -0,0 +1,70 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + async getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + + } + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231520.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231520.js new file mode 100644 index 00000000..89e5e754 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231520.js @@ -0,0 +1,80 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + async getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231538.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231538.js new file mode 100644 index 00000000..91de8066 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231538.js @@ -0,0 +1,80 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + async getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231555.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231555.js new file mode 100644 index 00000000..4b149dad --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231555.js @@ -0,0 +1,80 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + async getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 48-), + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231558.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231558.js new file mode 100644 index 00000000..d38dbc35 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231558.js @@ -0,0 +1,80 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + async getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231618.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231618.js new file mode 100644 index 00000000..83ade402 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231618.js @@ -0,0 +1,80 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + async getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231649.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231649.js new file mode 100644 index 00000000..9ca544c0 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231649.js @@ -0,0 +1,80 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + async getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.artist.albumSize, + } + } + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231657.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231657.js new file mode 100644 index 00000000..cb6b6c23 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231657.js @@ -0,0 +1,80 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + async getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231707.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231707.js new file mode 100644 index 00000000..a6b0e1f8 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231707.js @@ -0,0 +1,81 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + async getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手信息失败') + return { + source: 'kg', + singerid, + info: { + name: body.data.singername, + desc: body.data.intro, + img: body.data.imgurl.replace('{size}', '480'), + }, + } + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231721.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231721.js new file mode 100644 index 00000000..eb185fc9 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231721.js @@ -0,0 +1,68 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231724.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231724.js new file mode 100644 index 00000000..f9113f77 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231724.js @@ -0,0 +1,67 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232058.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232058.js new file mode 100644 index 00000000..6eb7e107 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232058.js @@ -0,0 +1,67 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232241.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232241.js new file mode 100644 index 00000000..fbdea121 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232241.js @@ -0,0 +1,71 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + const list = getMusicInfosByList(body.data.info) + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232451.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232451.js new file mode 100644 index 00000000..63e5d4a7 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232451.js @@ -0,0 +1,70 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + const list = getMusicInfosByList(body.data.info) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232500.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232500.js new file mode 100644 index 00000000..7ed93373 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232500.js @@ -0,0 +1,67 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + const list = getMusicInfosByList(body.data.info) + + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232526.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232526.js new file mode 100644 index 00000000..1fe0e427 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232526.js @@ -0,0 +1,68 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.data.info) throw new Error('get singer song list faild.') + const list = getMusicInfosByList(body.data.info) + + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232530.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232530.js new file mode 100644 index 00000000..98351381 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232530.js @@ -0,0 +1,69 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.data.info) throw new Error('get singer song list faild.') + + const list = getMusicInfosByList(body.data.info) + + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232532.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232532.js new file mode 100644 index 00000000..9a75b47f --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232532.js @@ -0,0 +1,69 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.data.info) throw new Error('get singer song list faild.') + + const list = getMusicInfosByList(body.data.info) + + let listData = await getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232535.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232535.js new file mode 100644 index 00000000..26d0304d --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232535.js @@ -0,0 +1,67 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.data.info) throw new Error('get singer song list faild.') + + const list = getMusicInfosByList(body.data.info) + return { + source: 'kg', + list: listData, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232556.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232556.js new file mode 100644 index 00000000..041cabb8 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232556.js @@ -0,0 +1,67 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.data.info) throw new Error('get singer song list faild.') + + const list = getMusicInfosByList(body.data.info) + return { + source: 'kg', + list, + id: `kg__singer_${singerid}`, + singerid, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232738.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232738.js new file mode 100644 index 00000000..10b11045 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232738.js @@ -0,0 +1,66 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.data.info) throw new Error('get singer song list faild.') + + const list = getMusicInfosByList(body.data.info) + return { + source: 'kg', + list, + limit, + total: body.data.total, + allPage: Math.ceil(body.data.total / limit), + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232741.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232741.js new file mode 100644 index 00000000..537e473a --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232741.js @@ -0,0 +1,65 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.data.info) throw new Error('get singer song list faild.') + + const list = getMusicInfosByList(body.data.info) + return { + source: 'kg', + list, + limit, + total: body.data.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232752.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232752.js new file mode 100644 index 00000000..244eb14f --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232752.js @@ -0,0 +1,66 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.data.info) throw new Error('get singer song list faild.') + + const list = getMusicInfosByList(body.data.info) + return { + source: 'kg', + list, + limit, + page, + total: body.data.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232804.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232804.js new file mode 100644 index 00000000..9a90048a --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232804.js @@ -0,0 +1,66 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233005.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233005.js new file mode 100644 index 00000000..7924a39c --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233005.js @@ -0,0 +1,65 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233020.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233020.js new file mode 100644 index 00000000..04dac6b2 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233020.js @@ -0,0 +1,67 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233027.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233027.js new file mode 100644 index 00000000..8a5818a1 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233027.js @@ -0,0 +1,67 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233257.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233257.js new file mode 100644 index 00000000..0ff7e4d9 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233257.js @@ -0,0 +1,67 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233415.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233415.js new file mode 100644 index 00000000..d1d0e350 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233415.js @@ -0,0 +1,71 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233553.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233553.js new file mode 100644 index 00000000..8b69d714 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233553.js @@ -0,0 +1,71 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233623.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233623.js new file mode 100644 index 00000000..ca074587 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233623.js @@ -0,0 +1,71 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + const list = this.filterAlbumList(body.info) + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234004.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234004.js new file mode 100644 index 00000000..28a2509b --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234004.js @@ -0,0 +1,73 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + const list = this.filterAlbumList(body.info) + return {} + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234010.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234010.js new file mode 100644 index 00000000..c49cb903 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234010.js @@ -0,0 +1,74 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return {} + }) + + const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`) + let { body, statusCode } = await requestObj.promise + if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') + return { + source: 'kg', + albums: this.filterAlbum(body.data.info), + singerid, + } + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234014.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234014.js new file mode 100644 index 00000000..6c2423f9 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234014.js @@ -0,0 +1,65 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return {} + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234022.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234022.js new file mode 100644 index 00000000..80582fe2 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234022.js @@ -0,0 +1,62 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return {} + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234034.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234034.js new file mode 100644 index 00000000..dbc09ed1 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234034.js @@ -0,0 +1,63 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return {} + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach((albumInfo) => { + list.push({ + name: albumInfo.albumname, + author: albumInfo.singername, + img: albumInfo.replaceAll('{size}', '480'), + album_id: albumInfo.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234146.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234146.js new file mode 100644 index 00000000..eea5d1b3 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234146.js @@ -0,0 +1,63 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return {} + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + list.push({ + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + album_id: item.albumid, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234208.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234208.js new file mode 100644 index 00000000..cff8f4e7 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234208.js @@ -0,0 +1,66 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return {} + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + list.push({ + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + album_id: item.albumid, + }, + + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234242.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234242.js new file mode 100644 index 00000000..d78b26d5 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234242.js @@ -0,0 +1,65 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return {} + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + list.push({ + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + album_id: item.albumid, + }, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234304.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234304.js new file mode 100644 index 00000000..6e0cf134 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234304.js @@ -0,0 +1,66 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return {} + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + list.push({ + id: item.albumid, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item. + }, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234309.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234309.js new file mode 100644 index 00000000..87b5d040 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234309.js @@ -0,0 +1,66 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return {} + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + list.push({ + id: item.albumid, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234337.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234337.js new file mode 100644 index 00000000..59cf7d94 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234337.js @@ -0,0 +1,67 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return {} + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + list.push({ + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + }) + }) + return list + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234401.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234401.js new file mode 100644 index 00000000..975bd582 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234401.js @@ -0,0 +1,65 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return {} + }) + }, + filterAlbumList(raw) { + return raw.map(item => { + return { + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + } + }) + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234433.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234433.js new file mode 100644 index 00000000..edff5106 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234433.js @@ -0,0 +1,71 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body. + } + }) + }, + filterAlbumList(raw) { + return raw.map(item => { + return { + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + } + }) + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234447.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234447.js new file mode 100644 index 00000000..f2fdfa16 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234447.js @@ -0,0 +1,71 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + async getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }) + }, + filterAlbumList(raw) { + return raw.map(item => { + return { + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + } + }) + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234507.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234507.js new file mode 100644 index 00000000..c19a38ac --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234507.js @@ -0,0 +1,71 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }) + }, + filterAlbumList(raw) { + return raw.map(item => { + return { + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + } + }) + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234515.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234515.js new file mode 100644 index 00000000..3b20b17a --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234515.js @@ -0,0 +1,71 @@ +import { httpFetch } from '../../request' +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + filterAlbumList(raw) { + return raw.map(item => { + return { + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + } + }) + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234527.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234527.js new file mode 100644 index 00000000..f3007e96 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234527.js @@ -0,0 +1,70 @@ +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + filterAlbumList(raw) { + return raw.map(item => { + return { + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + } + }) + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234802.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234802.js new file mode 100644 index 00000000..9a49b2b7 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234802.js @@ -0,0 +1,74 @@ +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + filterAlbumList(raw) { + return raw.map(item => { + return { + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + } + }) + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234808.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234808.js new file mode 100644 index 00000000..0cc63725 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234808.js @@ -0,0 +1,74 @@ +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(singerid) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + filterAlbumList(raw) { + return raw.map(item => { + return { + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + } + }) + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234837.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234837.js new file mode 100644 index 00000000..c96c145c --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234837.js @@ -0,0 +1,74 @@ +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + filterAlbumList(raw) { + return raw.map(item => { + return { + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + } + }) + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234843.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234843.js new file mode 100644 index 00000000..bc724cec --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234843.js @@ -0,0 +1,74 @@ +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + if (id == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${id}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + filterAlbumList(raw) { + return raw.map(item => { + return { + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + } + }) + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234902.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234902.js new file mode 100644 index 00000000..3f0b73fa --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234902.js @@ -0,0 +1,80 @@ +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + if (id == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${id}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} singerid + * @param {*} page + * @param {*} limit + */ + getAlbumList(singerid, page, limit) { + if (singerid == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + filterAlbumList(raw) { + return raw.map(item => { + return { + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + } + }) + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234910.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234910.js new file mode 100644 index 00000000..ce1e072b --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234910.js @@ -0,0 +1,80 @@ +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + if (id == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${id}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page, limit) { + if (id == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${id}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }) + }, + async getSongList(singerid, page = 1, limit = 100) { + if (singerid == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + filterAlbumList(raw) { + return raw.map(item => { + return { + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + } + }) + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234918.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234918.js new file mode 100644 index 00000000..ab26d60a --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234918.js @@ -0,0 +1,80 @@ +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + if (id == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${id}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page, limit) { + if (id == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${id}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }) + }, + async getSongList(id, page = 1, limit = 100) { + if (id == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${id}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + filterAlbumList(raw) { + return raw.map(item => { + return { + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + } + }) + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234940.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234940.js new file mode 100644 index 00000000..47ea1600 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234940.js @@ -0,0 +1,86 @@ +import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + if (id == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${id}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page, limit) { + if (id == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${id}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (id == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${id}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }, + filterAlbumList(raw) { + return raw.map(item => { + return { + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + } + }) + }, +} + diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609212734.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609212734.js new file mode 100644 index 00000000..e69de29b diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609212744.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609212744.js new file mode 100644 index 00000000..994a3a4f --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609212744.js @@ -0,0 +1,3 @@ +export default{ + +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609212850.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609212850.js new file mode 100644 index 00000000..cca076d1 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609212850.js @@ -0,0 +1,5 @@ +import { eapiRequest } from './utils/index' + +export default{ + +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609212930.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609212930.js new file mode 100644 index 00000000..b9aa3f42 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609212930.js @@ -0,0 +1,8 @@ +import { eapiRequest } from './utils/index' + +export default { + async getInfo(){ + + } + +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609212933.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609212933.js new file mode 100644 index 00000000..b5418364 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609212933.js @@ -0,0 +1,7 @@ +import { eapiRequest } from './utils/index' + +export default { + async getInfo(){ + + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213030.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213030.js new file mode 100644 index 00000000..bea8bc10 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213030.js @@ -0,0 +1,7 @@ +import { eapiRequest } from './utils/index' + +export default { + async getInfo(id){ + + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213037.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213037.js new file mode 100644 index 00000000..3ebc016c --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213037.js @@ -0,0 +1,8 @@ +import { eapiRequest } from './utils/index' + +export default { + async getInfo(id){ + + + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213052.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213052.js new file mode 100644 index 00000000..2f77bc78 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213052.js @@ -0,0 +1,8 @@ +import { eapiRequest } from './utils/index' + +export default { + getInfo(id){ + + + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213055.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213055.js new file mode 100644 index 00000000..4ae59364 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213055.js @@ -0,0 +1,6 @@ +import { eapiRequest } from './utils/index' + +export default { + getInfo(id){ + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213434.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213434.js new file mode 100644 index 00000000..10eb62c3 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213434.js @@ -0,0 +1,9 @@ +import { eapiRequest } from './utils/index' + +export default { + getInfo(id){ + return eapiRequest("/api/artist/head/info/get", { + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213452.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213452.js new file mode 100644 index 00000000..d740c45c --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213452.js @@ -0,0 +1,9 @@ +import { eapiRequest } from './utils/index' + +export default { + getInfo(id){ + return eapiRequest("/api/artist/head/info/get", { + id: 1143033, + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213501.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213501.js new file mode 100644 index 00000000..3317cb89 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213501.js @@ -0,0 +1,11 @@ +import { eapiRequest } from './utils/index' + +export default { + getInfo(id){ + return eapiRequest("/api/artist/head/info/get", { + id: 1143033, + }).then(body => { + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609214136.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609214136.js new file mode 100644 index 00000000..52b1acda --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609214136.js @@ -0,0 +1,11 @@ +import { eapiRequest } from './utils/index' + +export default { + getInfo(id){ + return eapiRequest("/api/artist/head/info/get", { + id: 1143033, + }).then(({ body }) => { + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609214159.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609214159.js new file mode 100644 index 00000000..ea546515 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609214159.js @@ -0,0 +1,11 @@ +import { eapiRequest } from './utils/index' + +export default { + async getInfo(id){ + const request = await eapiRequest("/api/artist/head/info/get", { + id: 1143033, + }).then(({ body }) => { + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609214211.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609214211.js new file mode 100644 index 00000000..1feed600 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609214211.js @@ -0,0 +1,9 @@ +import { eapiRequest } from './utils/index' + +export default { + async getInfo(id){ + const request = await eapiRequest("/api/artist/head/info/get", { id: 1143033 }).then(({ body }) => { + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609214218.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609214218.js new file mode 100644 index 00000000..8008135b --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609214218.js @@ -0,0 +1,8 @@ +import { eapiRequest } from './utils/index' + +export default { + async getInfo(id){ + const request = await eapiRequest("/api/artist/head/info/get", { id: 1143033 }) + + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609214941.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609214941.js new file mode 100644 index 00000000..f94b8481 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609214941.js @@ -0,0 +1,14 @@ +import { eapiRequest } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + * @returns + */ + async getInfo(id){ + return eapiRequest("/api/artist/head/info/get", { id: 1143033 }).then(({ body }) => { + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215009.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215009.js new file mode 100644 index 00000000..4da10a09 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215009.js @@ -0,0 +1,14 @@ +import { eapiRequest } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + * @returns + */ + async getInfo(id){ + return eapiRequest("/api/artist/head/info/get", { id }).then(({ body }) => { + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215649.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215649.js new file mode 100644 index 00000000..0fb79565 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215649.js @@ -0,0 +1,14 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + * @returns + */ + async getInfo(id){ + return eapiRequest("/api/artist/head/info/get", { id }).then(({ body }) => { + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215657.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215657.js new file mode 100644 index 00000000..46e07f4f --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215657.js @@ -0,0 +1,14 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + * @returns + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(({ body }) => { + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215709.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215709.js new file mode 100644 index 00000000..5a5c36c5 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215709.js @@ -0,0 +1,14 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + * @returns + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215719.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215719.js new file mode 100644 index 00000000..daba54b5 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215719.js @@ -0,0 +1,16 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + * @returns + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + return { + source: 'wy' + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215845.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215845.js new file mode 100644 index 00000000..e4c2a8cb --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215845.js @@ -0,0 +1,19 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + * @returns + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + return { + source: 'wy', + info: { + desc: + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220016.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220016.js new file mode 100644 index 00000000..3e29cddf --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220016.js @@ -0,0 +1,20 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + * @returns + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + return { + source: 'wy', + musicTotal: "", + info: { + desc: "", + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220055.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220055.js new file mode 100644 index 00000000..b8a3bc7d --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220055.js @@ -0,0 +1,21 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + * @returns + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + return { + source: 'wy', + musicTotal: "", + info: { + name: "", + desc: "", + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220127.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220127.js new file mode 100644 index 00000000..eb566ea2 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220127.js @@ -0,0 +1,22 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + * @returns + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + return { + source: 'wy', + musicTotal: "", + info: { + name: "", + desc: "", + avatar: "", + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220527.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220527.js new file mode 100644 index 00000000..ec1dc0f2 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220527.js @@ -0,0 +1,23 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + * @returns + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + musicTotal: "", + info: { + name: "", + desc: "", + avatar: "", + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220534.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220534.js new file mode 100644 index 00000000..6f01511f --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220534.js @@ -0,0 +1,24 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + * @returns + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + + return { + source: 'wy', + musicTotal: "", + info: { + name: "", + desc: "", + avatar: "", + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220545.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220545.js new file mode 100644 index 00000000..1035077c --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220545.js @@ -0,0 +1,23 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + + return { + source: 'wy', + musicTotal: "", + info: { + name: "", + desc: "", + avatar: "", + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220605.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220605.js new file mode 100644 index 00000000..2394b9b7 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220605.js @@ -0,0 +1,23 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + + return { + source: 'wy', + info: { + name: "", + desc: "", + avatar: "", + musicCount: 111, + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220615.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220615.js new file mode 100644 index 00000000..85327aa2 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220615.js @@ -0,0 +1,24 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + + return { + source: 'wy', + info: { + name: "", + desc: "", + avatar: "", + musicCount: 111, + albumCount: 111, + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221125.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221125.js new file mode 100644 index 00000000..7cd0adab --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221125.js @@ -0,0 +1,25 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + + return { + source: 'wy', + info: { + name: "", + desc: "", + avatar: "", + gender: "", + musicCount: 111, + albumCount: 111, + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221155.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221155.js new file mode 100644 index 00000000..7e38699f --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221155.js @@ -0,0 +1,27 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + + return { + source: 'wy', + info: { + name: "", + desc: "", + avatar: "", + gender: 1, + }, + count: { + music: 111, + album: 111, + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221158.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221158.js new file mode 100644 index 00000000..319a77a7 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221158.js @@ -0,0 +1,26 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: "", + desc: "", + avatar: "", + gender: 1, + }, + count: { + music: 111, + album: 111, + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221240.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221240.js new file mode 100644 index 00000000..707602ae --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221240.js @@ -0,0 +1,26 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: "", + desc: body.artist, + avatar: "", + gender: 1, + }, + count: { + music: 111, + album: 111, + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221248.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221248.js new file mode 100644 index 00000000..5a9af67f --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221248.js @@ -0,0 +1,26 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: "", + desc: body.artist.briefDesc, + avatar: "", + gender: 1, + }, + count: { + music: 111, + album: 111, + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221303.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221303.js new file mode 100644 index 00000000..7feaed21 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221303.js @@ -0,0 +1,26 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: "", + gender: 1, + }, + count: { + music: 111, + album: 111, + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221314.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221314.js new file mode 100644 index 00000000..6c27b8f5 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221314.js @@ -0,0 +1,26 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: "", + gender: 1, + }, + count: { + music: body.artist, + album: body.artist, + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221326.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221326.js new file mode 100644 index 00000000..16df8e1c --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221326.js @@ -0,0 +1,26 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: "", + gender: 1, + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221419.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221419.js new file mode 100644 index 00000000..f809e06f --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221419.js @@ -0,0 +1,26 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: "", + gender: body.user.gender === 1 ? '1' : "2", + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221422.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221422.js new file mode 100644 index 00000000..34ea7664 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221422.js @@ -0,0 +1,26 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: "", + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221436.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221436.js new file mode 100644 index 00000000..9a28f0da --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221436.js @@ -0,0 +1,26 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221847.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221847.js new file mode 100644 index 00000000..d15d2868 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221847.js @@ -0,0 +1,29 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + async getSongList(){ + + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221916.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221916.js new file mode 100644 index 00000000..1cd75889 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221916.js @@ -0,0 +1,35 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page, limit){ + + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221957.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221957.js new file mode 100644 index 00000000..48619cf5 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221957.js @@ -0,0 +1,36 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page, limit){ + return createEapiFetch('/api/v2/artist/songs', { id, limit}) + + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222018.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222018.js new file mode 100644 index 00000000..8a439873 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222018.js @@ -0,0 +1,37 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page, limit){ + return createEapiFetch('/api/v2/artist/songs', { id, limit }).then(body => { + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222227.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222227.js new file mode 100644 index 00000000..e34d8e75 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222227.js @@ -0,0 +1,41 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page, limit){ + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222449.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222449.js new file mode 100644 index 00000000..3b17fa1b --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222449.js @@ -0,0 +1,41 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100){ + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222504.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222504.js new file mode 100644 index 00000000..e8aec950 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222504.js @@ -0,0 +1,42 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100){ + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222523.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222523.js new file mode 100644 index 00000000..081eaf64 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222523.js @@ -0,0 +1,43 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100){ + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer info faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222543.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222543.js new file mode 100644 index 00000000..76aac108 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222543.js @@ -0,0 +1,43 @@ +import { createEapiFetch } from './utils/index' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100){ + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222828.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222828.js new file mode 100644 index 00000000..10695569 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222828.js @@ -0,0 +1,48 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw){ + raw.map(item => { + + }) + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100){ + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222834.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222834.js new file mode 100644 index 00000000..60f2c9da --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222834.js @@ -0,0 +1,48 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + raw.map(item => { + + }) + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id){ + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100){ + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222837.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222837.js new file mode 100644 index 00000000..4da04355 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222837.js @@ -0,0 +1,48 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + raw.map(item => { + + }) + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223044.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223044.js new file mode 100644 index 00000000..4da04355 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223044.js @@ -0,0 +1,48 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + raw.map(item => { + + }) + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223335.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223335.js new file mode 100644 index 00000000..2b6c89cc --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223335.js @@ -0,0 +1,50 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + raw.array.forEach(element => { + + });(item => { + + }) + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223338.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223338.js new file mode 100644 index 00000000..63147edf --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223338.js @@ -0,0 +1,48 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + raw.forEach(item => { + + }) + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223350.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223350.js new file mode 100644 index 00000000..3a3de7e7 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223350.js @@ -0,0 +1,49 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + + }) + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223400.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223400.js new file mode 100644 index 00000000..e3f07de6 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223400.js @@ -0,0 +1,50 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + const ids = new Set() + raw.forEach(item => { + + }) + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223403.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223403.js new file mode 100644 index 00000000..3a3de7e7 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223403.js @@ -0,0 +1,49 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + + }) + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223442.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223442.js new file mode 100644 index 00000000..85ae3ba0 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223442.js @@ -0,0 +1,50 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + }) + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223446.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223446.js new file mode 100644 index 00000000..aa686ee1 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223446.js @@ -0,0 +1,50 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + }) + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223552.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223552.js new file mode 100644 index 00000000..ca3fecd2 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223552.js @@ -0,0 +1,66 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223554.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223554.js new file mode 100644 index 00000000..c5c9bf51 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223554.js @@ -0,0 +1,66 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223604.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223604.js new file mode 100644 index 00000000..014768c5 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223604.js @@ -0,0 +1,67 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223619.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223619.js new file mode 100644 index 00000000..62543c32 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223619.js @@ -0,0 +1,68 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + const types = [] + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223622.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223622.js new file mode 100644 index 00000000..5a3da1d4 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223622.js @@ -0,0 +1,68 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + const types = {} + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223634.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223634.js new file mode 100644 index 00000000..ddb6de5a --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223634.js @@ -0,0 +1,69 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + const types = [] + const _types = {} + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223639.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223639.js new file mode 100644 index 00000000..eb372569 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223639.js @@ -0,0 +1,70 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223641.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223641.js new file mode 100644 index 00000000..c92fd173 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223641.js @@ -0,0 +1,70 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223656.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223656.js new file mode 100644 index 00000000..09694480 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223656.js @@ -0,0 +1,71 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege. + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223733.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223733.js new file mode 100644 index 00000000..6bcb12f4 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223733.js @@ -0,0 +1,76 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch() { + + } + + } ) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223747.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223747.js new file mode 100644 index 00000000..76ab1248 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223747.js @@ -0,0 +1,77 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch(i.rate) { + case + + } + + } ) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223753.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223753.js new file mode 100644 index 00000000..f4bd35ca --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223753.js @@ -0,0 +1,78 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch(i.rate) { + case 128000: + + + } + + } ) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223816.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223816.js new file mode 100644 index 00000000..21a95a17 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223816.js @@ -0,0 +1,94 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch(i.rate) { + case 999000: + size = item.sq ? sizeFormate(item.sq.size) : null + types.push({ type: 'flac', size }) + _types.flac = { + size, + } + case 320000: + size = item.h ? sizeFormate(item.h.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 192000: + case 128000: + size = item.l ? sizeFormate(item.l.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + } + + } ) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223823.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223823.js new file mode 100644 index 00000000..04e2bccb --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223823.js @@ -0,0 +1,93 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 999000: + size = item.sq ? sizeFormate(item.sq.size) : null + types.push({ type: 'flac', size }) + _types.flac = { + size, + } + case 320000: + size = item.h ? sizeFormate(item.h.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 192000: + case 128000: + size = item.l ? sizeFormate(item.l.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223827.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223827.js new file mode 100644 index 00000000..9abd6f9c --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223827.js @@ -0,0 +1,92 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 999000: + size = item.sq ? sizeFormate(item.sq.size) : null + types.push({ type: 'flac', size }) + _types.flac = { + size, + } + case 320000: + size = item.h ? sizeFormate(item.h.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 128000: + size = item.l ? sizeFormate(item.l.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224031.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224031.js new file mode 100644 index 00000000..bc686d45 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224031.js @@ -0,0 +1,98 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 999000: + size = item.sq ? sizeFormate(item.sq.size) : null + types.push({ type: 'flac', size }) + _types.flac = { + size, + } + case 320000: + size = item.h ? sizeFormate(item.h.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 128000: + size = item.l ? sizeFormate(item.l.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 1999000: + size = item.l ? sizeFormate(item.l.size) : null + types.push({ type: '128k', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224036.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224036.js new file mode 100644 index 00000000..556e095f --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224036.js @@ -0,0 +1,98 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 999000: + size = item.sq ? sizeFormate(item.sq.size) : null + types.push({ type: 'flac', size }) + _types.flac = { + size, + } + case 320000: + size = item.h ? sizeFormate(item.h.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 128000: + size = item.l ? sizeFormate(item.l.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 1999000: + size = item.l ? sizeFormate(item.l.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224056.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224056.js new file mode 100644 index 00000000..d5100053 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224056.js @@ -0,0 +1,98 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 999000: + size = item.sq ? sizeFormate(item.sq.size) : null + types.push({ type: 'flac', size }) + _types.flac = { + size, + } + case 320000: + size = item.h ? sizeFormate(item.h.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 128000: + size = item.l ? sizeFormate(item.l.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224110.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224110.js new file mode 100644 index 00000000..29436010 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224110.js @@ -0,0 +1,98 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 999000: + size = item.sq ? sizeFormate(item.sq.size) : null + types.push({ type: 'flac', size }) + _types.flac = { + size, + } + case 320000: + size = item.h ? sizeFormate(item.h.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 128000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224136.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224136.js new file mode 100644 index 00000000..3412259c --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224136.js @@ -0,0 +1,98 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 999000: + size = item.sq ? sizeFormate(item.sq.size) : null + types.push({ type: 'flac', size }) + _types.flac = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 128000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224159.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224159.js new file mode 100644 index 00000000..f7a72f42 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224159.js @@ -0,0 +1,98 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 999000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: 'flac', size }) + _types.flac = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 128000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224216.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224216.js new file mode 100644 index 00000000..9e099825 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224216.js @@ -0,0 +1,98 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 999000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 128000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224229.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224229.js new file mode 100644 index 00000000..95deb49c --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224229.js @@ -0,0 +1,98 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224359.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224359.js new file mode 100644 index 00000000..e15307fb --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224359.js @@ -0,0 +1,98 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.audio_info.audio_id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224416.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224416.js new file mode 100644 index 00000000..7c0a8f96 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224416.js @@ -0,0 +1,98 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.id, + source: 'kg', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224418.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224418.js new file mode 100644 index 00000000..3feb4652 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224418.js @@ -0,0 +1,98 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: decodeName(item.name), + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224432.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224432.js new file mode 100644 index 00000000..2b66e801 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224432.js @@ -0,0 +1,98 @@ +import { createEapiFetch } from './utils/index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: item.name, + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224457.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224457.js new file mode 100644 index 00000000..765e6b6b --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224457.js @@ -0,0 +1,99 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime } from '../utils' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: item.name, + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224519.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224519.js new file mode 100644 index 00000000..69d6add4 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224519.js @@ -0,0 +1,99 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime } from '../../music' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: item.name, + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224547.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224547.js new file mode 100644 index 00000000..044a0cfc --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224547.js @@ -0,0 +1,99 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: item.name, + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224621.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224621.js new file mode 100644 index 00000000..5a7cebde --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224621.js @@ -0,0 +1,99 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: item.name, + albumName: decodeName(item.album_info.album_name), + albumId: item.album_info.album_id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224651.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224651.js new file mode 100644 index 00000000..fd53b34a --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224651.js @@ -0,0 +1,99 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: item.name, + albumName: item.album.name, + albumId: item.album_info.album_id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224705.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224705.js new file mode 100644 index 00000000..69993629 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224705.js @@ -0,0 +1,99 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224959.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224959.js new file mode 100644 index 00000000..9d195bb9 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224959.js @@ -0,0 +1,100 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: decodeName(item.author_name), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225008.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225008.js new file mode 100644 index 00000000..37a5d301 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225008.js @@ -0,0 +1,100 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.author_name), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225015.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225015.js new file mode 100644 index 00000000..705684a5 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225015.js @@ -0,0 +1,100 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + hash: item.audio_info.hash, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225029.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225029.js new file mode 100644 index 00000000..452049b1 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225029.js @@ -0,0 +1,99 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225557.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225557.js new file mode 100644 index 00000000..b45340a5 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225557.js @@ -0,0 +1,99 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + return filterSongList(body) + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225623.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225623.js new file mode 100644 index 00000000..1d069461 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225623.js @@ -0,0 +1,99 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + return filterSongList(body.filterSongList) + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225628.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225628.js new file mode 100644 index 00000000..8a7a1f9d --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225628.js @@ -0,0 +1,99 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + async getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225739.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225739.js new file mode 100644 index 00000000..351ae2be --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225739.js @@ -0,0 +1,102 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + getAlbumList() { + + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225749.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225749.js new file mode 100644 index 00000000..2796d227 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225749.js @@ -0,0 +1,102 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + getAlbumList(id, page = 1, limit = 10) { + + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225803.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225803.js new file mode 100644 index 00000000..51f884df --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225803.js @@ -0,0 +1,108 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225956.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225956.js new file mode 100644 index 00000000..03d989f2 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225956.js @@ -0,0 +1,116 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230028.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230028.js new file mode 100644 index 00000000..9b2adfbb --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230028.js @@ -0,0 +1,115 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230036.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230036.js new file mode 100644 index 00000000..1a540b12 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230036.js @@ -0,0 +1,115 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230053.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230053.js new file mode 100644 index 00000000..6563b2da --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230053.js @@ -0,0 +1,115 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterSongList(body.hotAlbums) + }) + } +} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230116.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230116.js new file mode 100644 index 00000000..9e9f1c75 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230116.js @@ -0,0 +1,115 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterSongList(body.hotAlbums) + }) + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230133.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230133.js new file mode 100644 index 00000000..307e461a --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230133.js @@ -0,0 +1,118 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterSongList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + + } + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230135.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230135.js new file mode 100644 index 00000000..2012c217 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230135.js @@ -0,0 +1,118 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterSongList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230201.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230201.js new file mode 100644 index 00000000..04051a59 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230201.js @@ -0,0 +1,122 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterSongList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230241.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230241.js new file mode 100644 index 00000000..b756ed40 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230241.js @@ -0,0 +1,122 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230313.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230313.js new file mode 100644 index 00000000..05b4e85d --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230313.js @@ -0,0 +1,124 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230317.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230317.js new file mode 100644 index 00000000..49f29465 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230317.js @@ -0,0 +1,122 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230344.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230344.js new file mode 100644 index 00000000..6a28a99b --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230344.js @@ -0,0 +1,129 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + list.push({ + id: item.id, + info: { + + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230357.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230357.js new file mode 100644 index 00000000..a34e2f8b --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230357.js @@ -0,0 +1,130 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + list.push({ + id: item.id, + info: { + name: item.name + + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230431.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230431.js new file mode 100644 index 00000000..792aa382 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230431.js @@ -0,0 +1,131 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + list.push({ + id: item.id, + count: item.size, + info: { + name: item.name + + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230456.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230456.js new file mode 100644 index 00000000..e950a184 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230456.js @@ -0,0 +1,132 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + list.push({ + id: item.id, + count: item.size, + info: { + name: item.name, + img: item.picUrl, + desc: "", + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230656.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230656.js new file mode 100644 index 00000000..abac22fd --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230656.js @@ -0,0 +1,132 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + list.push({ + id: item.id, + count: item.size, + info: { + name: item.name, + img: item.picUrl, + desc: null, + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230702.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230702.js new file mode 100644 index 00000000..8e375d9d --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230702.js @@ -0,0 +1,131 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + list.push({ + id: item.id, + count: item.size, + info: { + name: item.name, + img: item.picUrl, + desc: null, + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230727.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230727.js new file mode 100644 index 00000000..1ec64465 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230727.js @@ -0,0 +1,132 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + list.push({ + id: item.id, + count: item.size, + info: { + name: item.name, + author: formatSingerName(item), + img: item.picUrl, + desc: null, + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230734.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230734.js new file mode 100644 index 00000000..0e9c28f0 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230734.js @@ -0,0 +1,132 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + list.push({ + id: item.id, + count: item.size, + info: { + name: item.name, + author: formatSingerName(item.artists), + img: item.picUrl, + desc: null, + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609232004.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609232004.js new file mode 100644 index 00000000..89fcd899 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609232004.js @@ -0,0 +1,133 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + id: body.artist.id, + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + return filterSongList(body.songs) + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + list.push({ + id: item.id, + count: item.size, + info: { + name: item.name, + author: formatSingerName(item.artists), + img: item.picUrl, + desc: null, + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609232819.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609232819.js new file mode 100644 index 00000000..b48cebf8 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609232819.js @@ -0,0 +1,135 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + id: body.artist.id, + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + + const list = filterSongList(body.songs) + return + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + list.push({ + id: item.id, + count: item.size, + info: { + name: item.name, + author: formatSingerName(item.artists), + img: item.picUrl, + desc: null, + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609232854.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609232854.js new file mode 100644 index 00000000..796770a5 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609232854.js @@ -0,0 +1,141 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + id: body.artist.id, + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + + const list = filterSongList(body.songs) + return { + list, + limit, + page, + // total: + source: 'wy', + } + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + list.push({ + id: item.id, + count: item.size, + info: { + name: item.name, + author: formatSingerName(item.artists), + img: item.picUrl, + desc: null, + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609232950.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609232950.js new file mode 100644 index 00000000..18c7d255 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609232950.js @@ -0,0 +1,141 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + id: body.artist.id, + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + + const list = filterSongList(body.songs) + return { + list, + limit, + page, + total: body.total + source: 'wy', + } + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + list.push({ + id: item.id, + count: item.size, + info: { + name: item.name, + author: formatSingerName(item.artists), + img: item.picUrl, + desc: null, + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609232952.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609232952.js new file mode 100644 index 00000000..8cd23fbd --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609232952.js @@ -0,0 +1,141 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + id: body.artist.id, + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + + const list = filterSongList(body.songs) + return { + list, + limit, + page, + total: body.total, + source: 'wy', + } + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + return filterAlbumList(body.hotAlbums) + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + list.push({ + id: item.id, + count: item.size, + info: { + name: item.name, + author: formatSingerName(item.artists), + img: item.picUrl, + desc: null, + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609234543.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609234543.js new file mode 100644 index 00000000..42cef820 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609234543.js @@ -0,0 +1,143 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + id: body.artist.id, + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + + const list = filterSongList(body.songs) + return { + list, + limit, + page, + total: body.total, + source: 'wy', + } + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + + const list = this.filterAlbumList(body.hotAlbums) + return + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + list.push({ + id: item.id, + count: item.size, + info: { + name: item.name, + author: formatSingerName(item.artists), + img: item.picUrl, + desc: null, + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609234610.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609234610.js new file mode 100644 index 00000000..6a7251d8 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609234610.js @@ -0,0 +1,148 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + id: body.artist.id, + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + + const list = this.filterSongList(body.songs) + return { + list, + limit, + page, + total: body.total, + source: 'wy', + } + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + + const list = this.filterAlbumList(body.hotAlbums) + return { + source: 'wy', + list, + limit, + page, + } + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + list.push({ + id: item.id, + count: item.size, + info: { + name: item.name, + author: formatSingerName(item.artists), + img: item.picUrl, + desc: null, + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609234742.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609234742.js new file mode 100644 index 00000000..000d3b88 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/singer_20230609234742.js @@ -0,0 +1,149 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + id: body.artist.id, + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + + const list = this.filterSongList(body.songs) + return { + list, + limit, + page, + total: body.total, + source: 'wy', + } + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + + const list = this.filterAlbumList(body.hotAlbums) + return { + source: 'wy', + list, + limit, + page, + total: body.artist.albumSize + } + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + list.push({ + id: item.id, + count: item.size, + info: { + name: item.name, + author: formatSingerName(item.artists), + img: item.picUrl, + desc: null, + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230521134626.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230521134626.js new file mode 100644 index 00000000..ce27143e --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230521134626.js @@ -0,0 +1,22 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213722.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213722.js new file mode 100644 index 00000000..d194a8d9 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213722.js @@ -0,0 +1,49 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于KG的Http请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createHttpFetch = async(url, options, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + let result + try { + result = await httpFetch(url, options).promise + } catch (err) { + console.log(err) + return createHttpFetch(url, options, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || + ( + result.body.error_code ?? + result.body.errcode ?? + result.body.err_code) != 0 + ) return createHttpFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213741.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213741.js new file mode 100644 index 00000000..d3414645 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213741.js @@ -0,0 +1,48 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于KG的Http请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createHttpFetch = async(url, options, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + let result + try { + result = await httpFetch(url, options).promise + } catch (err) { + console.log(err) + return createHttpFetch(url, options, ++retryNum) + } + if (result.statusCode !== 200 || + ( + result.body.error_code ?? + result.body.errcode ?? + result.body.err_code) != 0 + ) return createHttpFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213807.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213807.js new file mode 100644 index 00000000..dee31083 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213807.js @@ -0,0 +1,43 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于KG的Http请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createHttpFetch = async(url, options, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + let result + try { + result = await httpFetch(url, options).promise + } catch (err) { + console.log(err) + return createHttpFetch(url, options, ++retryNum) + } + if (result.statusCode !== 200 || result.body.code != 200) return createHttpFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213814.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213814.js new file mode 100644 index 00000000..4077b07d --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213814.js @@ -0,0 +1,43 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Http请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createHttpFetch = async(url, options, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + let result + try { + result = await httpFetch(url, options).promise + } catch (err) { + console.log(err) + return createHttpFetch(url, options, ++retryNum) + } + if (result.statusCode !== 200 || result.body.code != 200) return createHttpFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213832.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213832.js new file mode 100644 index 00000000..f1b5140b --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213832.js @@ -0,0 +1,42 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Http请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createHttpFetch = async(url, options, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + let result + try { + result = await httpFetch(url, options).promise + } catch (err) { + console.log(err) + return createHttpFetch(url, options, ++retryNum) + } + if (result.statusCode !== 200 || result.body.code != 200) return createHttpFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + return result.body +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609214124.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609214124.js new file mode 100644 index 00000000..ce27143e --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609214124.js @@ -0,0 +1,22 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215059.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215059.js new file mode 100644 index 00000000..aee2a75d --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215059.js @@ -0,0 +1,49 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, options, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + let result + try { + result = await httpFetch(url, options).promise + } catch (err) { + console.log(err) + return createHttpFetch(url, options, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || + ( + result.body.error_code ?? + result.body.errcode ?? + result.body.err_code) != 0 + ) return createHttpFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215140.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215140.js new file mode 100644 index 00000000..a1b9eca8 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215140.js @@ -0,0 +1,49 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + let result + try { + result = await httpFetch(url, options).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || + ( + result.body.error_code ?? + result.body.errcode ?? + result.body.err_code) != 0 + ) return createEapiFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215240.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215240.js new file mode 100644 index 00000000..d43c57b6 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215240.js @@ -0,0 +1,50 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + let result + try { + result = await httpFetch(url, options).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || + ( + result.body.error_code ?? + result.body.errcode ?? + result.body.err_code) != 0 + ) return createEapiFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215413.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215413.js new file mode 100644 index 00000000..63fe85ba --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215413.js @@ -0,0 +1,63 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: data, + }) +} + + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + let result + try { + result = await httpFetch(url, options).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || + ( + result.body.error_code ?? + result.body.errcode ?? + result.body.err_code) != 0 + ) return createEapiFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215428.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215428.js new file mode 100644 index 00000000..d2d26b34 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215428.js @@ -0,0 +1,63 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: data, + }) +} + + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + let result + try { + result = await httpFetch(url, options).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || + ( + result.body.error_code ?? + result.body.errcode ?? + result.body.err_code) != 0 + ) return createEapiFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215435.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215435.js new file mode 100644 index 00000000..a8dabe93 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215435.js @@ -0,0 +1,62 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: data, + }) +} + + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + let result + try { + result = await httpFetch(url, options).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || + ( + result.body.error_code ?? + result.body.errcode ?? + result.body.err_code) != 0 + ) return createEapiFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215438.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215438.js new file mode 100644 index 00000000..98623eb1 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215438.js @@ -0,0 +1,61 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: data, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + let result + try { + result = await httpFetch(url, options).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || + ( + result.body.error_code ?? + result.body.errcode ?? + result.body.err_code) != 0 + ) return createEapiFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215445.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215445.js new file mode 100644 index 00000000..23f7ff93 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215445.js @@ -0,0 +1,61 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: data, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + let result + try { + result = await buildEapiRequest(url, options).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || + ( + result.body.error_code ?? + result.body.errcode ?? + result.body.err_code) != 0 + ) return createEapiFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215451.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215451.js new file mode 100644 index 00000000..df62bab4 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215451.js @@ -0,0 +1,61 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: data, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + let result + try { + result = await buildEapiRequest(data).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || + ( + result.body.error_code ?? + result.body.errcode ?? + result.body.err_code) != 0 + ) return createEapiFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215506.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215506.js new file mode 100644 index 00000000..6f116202 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215506.js @@ -0,0 +1,61 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: data, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + let result + try { + result = await buildEapiRequest(fromData).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || + ( + result.body.error_code ?? + result.body.errcode ?? + result.body.err_code) != 0 + ) return createEapiFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215510.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215510.js new file mode 100644 index 00000000..0a79acea --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215510.js @@ -0,0 +1,62 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: data, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + + let result + try { + result = await buildEapiRequest(fromData).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || + ( + result.body.error_code ?? + result.body.errcode ?? + result.body.err_code) != 0 + ) return createEapiFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215513.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215513.js new file mode 100644 index 00000000..385bfaff --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215513.js @@ -0,0 +1,62 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: data, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + + let result + try { + result = await buildEapiRequest(fromData).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || + ( + result.body.error_code ?? + result.body.errcode ?? + result.body.err_code) != 0 + ) return createEapiFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215535.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215535.js new file mode 100644 index 00000000..21a5efe3 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215535.js @@ -0,0 +1,57 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: data, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + + let result + try { + result = await buildEapiRequest(fromData).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, options, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215546.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215546.js new file mode 100644 index 00000000..20cb3533 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215546.js @@ -0,0 +1,57 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: data, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + + let result + try { + result = await buildEapiRequest(fromData).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) + if (result.body.data) return result.body.data + if (Array.isArray(result.body.info)) return result.body + return result.body.info +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215557.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215557.js new file mode 100644 index 00000000..195cb895 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215557.js @@ -0,0 +1,56 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: data, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + + let result + try { + result = await buildEapiRequest(fromData).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + // console.log(result.statusCode, result.body) + if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) + if (result.body.data) return result.body.data + return result.body +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215601.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215601.js new file mode 100644 index 00000000..f9b6c522 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215601.js @@ -0,0 +1,56 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: data, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + + let result + try { + result = await buildEapiRequest(fromData).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + + if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) + if (result.body.data) return result.body.data + return result.body +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215616.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215616.js new file mode 100644 index 00000000..4e7499f7 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215616.js @@ -0,0 +1,56 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (from) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: data, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + + let result + try { + result = await buildEapiRequest(fromData).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + + if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) + if (result.body.data) return result.body.data + return result.body +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215628.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215628.js new file mode 100644 index 00000000..e1aed9a7 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215628.js @@ -0,0 +1,56 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (formData) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: formData, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const fromData = eapi(url, data) + + let result + try { + result = await buildEapiRequest(fromData).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + + if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) + if (result.body.data) return result.body.data + return result.body +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215641.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215641.js new file mode 100644 index 00000000..d7eb763e --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215641.js @@ -0,0 +1,56 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (formData) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: formData, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const formData = eapi(url, data) + + let result + try { + result = await buildEapiRequest(formData).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + + if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) + if (result.body.data) return result.body.data + return result.body +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224836.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224836.js new file mode 100644 index 00000000..8f5c8af8 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224836.js @@ -0,0 +1,64 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (formData) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: formData, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const formData = eapi(url, data) + + let result + try { + result = await buildEapiRequest(formData).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + + if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) + if (result.body.data) return result.body.data + return result.body +} + +getSinger(singers) { + let arr = [] + singers?.forEach(singer => { + arr.push(singer.name) + }) + return arr.join('、') +}, diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224839.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224839.js new file mode 100644 index 00000000..38602304 --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224839.js @@ -0,0 +1,64 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (formData) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: formData, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const formData = eapi(url, data) + + let result + try { + result = await buildEapiRequest(formData).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + + if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) + if (result.body.data) return result.body.data + return result.body +} + +getSinger(singers) { + let arr = [] + singers?.forEach(singer => { + arr.push(singer.name) + }) + return arr.join('、') +} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224855.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224855.js new file mode 100644 index 00000000..d7eb763e --- /dev/null +++ b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224855.js @@ -0,0 +1,56 @@ +import { httpFetch } from '../../../request' +import { eapi } from './crypto' + +const buildEapiRequest = (formData) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: formData, + }) +} + +export const eapiRequest = (url, data) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'post', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', + }, + form: eapi(url, data), + }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // // console.log(raw) + // console.log(body) + // // console.log(eapiDecrypt(raw)) + // // return eapiDecrypt(raw) + // return body + // }) + // return requestObj +} + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const formData = eapi(url, data) + + let result + try { + result = await buildEapiRequest(formData).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + + if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) + if (result.body.data) return result.body.data + return result.body +} diff --git a/src/renderer/utils/musicSdk/kg/singer.js b/src/renderer/utils/musicSdk/kg/singer.js index b2f9394e..47ea1600 100644 --- a/src/renderer/utils/musicSdk/kg/singer.js +++ b/src/renderer/utils/musicSdk/kg/singer.js @@ -1,59 +1,86 @@ -import { httpFetch } from '../../request' -// import { decodeName, formatPlayTime, sizeFormate } from '../../index' -// import { signatureParams } from './util' import { getMusicInfosByList } from './musicInfo' +import { createHttpFetch } from './util' export default { - filterAlbum(rawList) { - let returnList = [] - rawList.forEach((albumInfo) => { - returnList.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + if (id == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${id}`).then(body => { + if (!body) throw new Error('get singer info faild.') + + return { + source: 'kg', + id: body.singerid, + info: { + name: body.singername, + desc: body.intro, + avatar: body.imgurl.replace('{size}', 480), + gender: body.grade === 1 ? '1' : '2', + }, + count: { + music: body.songcount, + album: body.albumcount, + } + } }) }, - async getSingerInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page, limit) { + if (id == 0) throw new Error('歌手不存在') + return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${id}&page=${page}&pagesize=${limit}`).then(body => { + if (!body.info) throw new Error('get singer album faild.') + + const list = this.filterAlbumList(body.info) + return { + source: 'kg', + list, + limit, + page, + total: body.total, + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + async getSongList(id, page = 1, limit = 100) { + if (id == 0) throw new Error('歌手不存在') + const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${id}&page=${page}&pagesize=${limit}`) + if (!body.info) throw new Error('get singer song list faild.') + + const list = await getMusicInfosByList(body.info) return { source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, + list, + limit, + page, + total: body.total, } }, - async getSingerSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getSingerAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } + filterAlbumList(raw) { + return raw.map(item => { + return { + id: item.albumid, + count: item.songcount, + info: { + name: item.albumname, + author: item.singername, + img: item.replaceAll('{size}', '480'), + desc: item.intro, + }, + } + }) }, } + diff --git a/src/renderer/utils/musicSdk/wy/singer.js b/src/renderer/utils/musicSdk/wy/singer.js new file mode 100644 index 00000000..000d3b88 --- /dev/null +++ b/src/renderer/utils/musicSdk/wy/singer.js @@ -0,0 +1,149 @@ +import { createEapiFetch } from './utils/index' +import { formatPlayTime, sizeFormate } from '../../index' +import { formatSingerName } from '../utils' + +export default { + /** + * 获取歌手信息 + * @param {*} id + */ + getInfo(id) { + return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { + if (!body) throw new Error("get singer info faild.") + return { + source: 'wy', + id: body.artist.id, + info: { + name: body.artist.name, + desc: body.artist.briefDesc, + avatar: body.user.avatarUrl, + gender: body.user.gender === 1 ? '1' : '2', + }, + count: { + music: body.artist.musicSize, + album: body.artist.albumSize, + } + } + }) + }, + /** + * 获取歌手歌曲列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getSongList(id, page = 1, limit = 100) { + if (page === 1) page = 0 + return createEapiFetch('/api/v2/artist/songs', { + id, + limit, + offset: limit * page + }).then(body => { + if (!body.songs) throw new Error("get singer songs faild.") + + const list = this.filterSongList(body.songs) + return { + list, + limit, + page, + total: body.total, + source: 'wy', + } + }) + }, + /** + * 获取歌手专辑列表 + * @param {*} id + * @param {*} page + * @param {*} limit + */ + getAlbumList(id, page = 1, limit = 10) { + if (page === 1) page = 0 + return createEapiFetch(`/api/artist/albums/${id}`, { + limit, + offset: limit * page + }).then(body => { + if (!body.hotAlbums) throw new Error("get singer songs faild.") + + const list = this.filterAlbumList(body.hotAlbums) + return { + source: 'wy', + list, + limit, + page, + total: body.artist.albumSize + } + }) + }, + filterAlbumList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + list.push({ + id: item.id, + count: item.size, + info: { + name: item.name, + author: formatSingerName(item.artists), + img: item.picUrl, + desc: null, + }, + }) + }) + return list + }, + filterSongList(raw) { + const list = [] + raw.forEach(item => { + if (!item.id) return + + const types = [] + const _types = {} + item.privilege.chargeInfoList.forEach(i => { + switch (i.rate) { + case 128000: + size = item.lMusic ? sizeFormate(item.lMusic.size) : null + types.push({ type: '128k', size }) + _types['128k'] = { + size, + } + case 320000: + size = item.hMusic ? sizeFormate(item.hMusic.size) : null + types.push({ type: '320k', size }) + _types['320k'] = { + size, + } + case 999000: + size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null + types.push({ type: 'flac', size }) + _typesflac = { + size, + } + case 1999000: + size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null + types.push({ type: 'flac24bit', size }) + _types.flac24bit = { + size, + } + } + }) + + list.push({ + singer: formatSingerName(item.artists), + name: item.name, + albumName: item.album.name, + albumId: item.album.id, + songmid: item.id, + source: 'wy', + interval: formatPlayTime(item.duration), + img: null, + lrc: null, + otherSource: null, + types, + _types, + typeUrl: {}, + }) + }) + return list + }, +} diff --git a/src/renderer/utils/musicSdk/wy/utils/index.js b/src/renderer/utils/musicSdk/wy/utils/index.js index ce27143e..d7eb763e 100644 --- a/src/renderer/utils/musicSdk/wy/utils/index.js +++ b/src/renderer/utils/musicSdk/wy/utils/index.js @@ -1,6 +1,17 @@ import { httpFetch } from '../../../request' import { eapi } from './crypto' +const buildEapiRequest = (formData) => { + return httpFetch('http://interface.music.163.com/eapi/batch', { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + origin: 'https://music.163.com', + }, + form: formData, + }) +} + export const eapiRequest = (url, data) => { return httpFetch('http://interface.music.163.com/eapi/batch', { method: 'post', @@ -20,3 +31,26 @@ export const eapiRequest = (url, data) => { // }) // return requestObj } + +/** + * 创建一个适用于WY的Eapi请求 + * @param {*} url + * @param {*} options + * @param {*} retryNum + */ +export const createEapiFetch = async(url, data, retryNum = 0) => { + if (retryNum > 2) throw new Error('try max num') + const formData = eapi(url, data) + + let result + try { + result = await buildEapiRequest(formData).promise + } catch (err) { + console.log(err) + return createEapiFetch(url, data, ++retryNum) + } + + if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) + if (result.body.data) return result.body.data + return result.body +} From 25864220ae58a06aa1c870a3b911c04e5af8f079 Mon Sep 17 00:00:00 2001 From: Folltoshe Date: Fri, 9 Jun 2023 23:52:58 +0800 Subject: [PATCH 7/7] fix --- .../musicSdk/kg/singer_20230609203128.js | 59 ------- .../musicSdk/kg/singer_20230609230828.js | 60 ------- .../musicSdk/kg/singer_20230609230857.js | 58 ------- .../musicSdk/kg/singer_20230609230914.js | 58 ------- .../musicSdk/kg/singer_20230609230921.js | 59 ------- .../musicSdk/kg/singer_20230609230937.js | 59 ------- .../musicSdk/kg/singer_20230609230943.js | 60 ------- .../musicSdk/kg/singer_20230609230950.js | 62 -------- .../musicSdk/kg/singer_20230609230955.js | 62 -------- .../musicSdk/kg/singer_20230609231029.js | 63 -------- .../musicSdk/kg/singer_20230609231127.js | 67 -------- .../musicSdk/kg/singer_20230609231135.js | 70 -------- .../musicSdk/kg/singer_20230609231520.js | 80 ---------- .../musicSdk/kg/singer_20230609231538.js | 80 ---------- .../musicSdk/kg/singer_20230609231555.js | 80 ---------- .../musicSdk/kg/singer_20230609231558.js | 80 ---------- .../musicSdk/kg/singer_20230609231618.js | 80 ---------- .../musicSdk/kg/singer_20230609231649.js | 80 ---------- .../musicSdk/kg/singer_20230609231657.js | 80 ---------- .../musicSdk/kg/singer_20230609231707.js | 81 ---------- .../musicSdk/kg/singer_20230609231721.js | 68 -------- .../musicSdk/kg/singer_20230609231724.js | 67 -------- .../musicSdk/kg/singer_20230609232058.js | 67 -------- .../musicSdk/kg/singer_20230609232241.js | 71 --------- .../musicSdk/kg/singer_20230609232451.js | 70 -------- .../musicSdk/kg/singer_20230609232500.js | 67 -------- .../musicSdk/kg/singer_20230609232526.js | 68 -------- .../musicSdk/kg/singer_20230609232530.js | 69 -------- .../musicSdk/kg/singer_20230609232532.js | 69 -------- .../musicSdk/kg/singer_20230609232535.js | 67 -------- .../musicSdk/kg/singer_20230609232556.js | 67 -------- .../musicSdk/kg/singer_20230609232738.js | 66 -------- .../musicSdk/kg/singer_20230609232741.js | 65 -------- .../musicSdk/kg/singer_20230609232752.js | 66 -------- .../musicSdk/kg/singer_20230609232804.js | 66 -------- .../musicSdk/kg/singer_20230609233005.js | 65 -------- .../musicSdk/kg/singer_20230609233020.js | 67 -------- .../musicSdk/kg/singer_20230609233027.js | 67 -------- .../musicSdk/kg/singer_20230609233257.js | 67 -------- .../musicSdk/kg/singer_20230609233415.js | 71 --------- .../musicSdk/kg/singer_20230609233553.js | 71 --------- .../musicSdk/kg/singer_20230609233623.js | 71 --------- .../musicSdk/kg/singer_20230609234004.js | 73 --------- .../musicSdk/kg/singer_20230609234010.js | 74 --------- .../musicSdk/kg/singer_20230609234014.js | 65 -------- .../musicSdk/kg/singer_20230609234022.js | 62 -------- .../musicSdk/kg/singer_20230609234034.js | 63 -------- .../musicSdk/kg/singer_20230609234146.js | 63 -------- .../musicSdk/kg/singer_20230609234208.js | 66 -------- .../musicSdk/kg/singer_20230609234242.js | 65 -------- .../musicSdk/kg/singer_20230609234304.js | 66 -------- .../musicSdk/kg/singer_20230609234309.js | 66 -------- .../musicSdk/kg/singer_20230609234337.js | 67 -------- .../musicSdk/kg/singer_20230609234401.js | 65 -------- .../musicSdk/kg/singer_20230609234433.js | 71 --------- .../musicSdk/kg/singer_20230609234447.js | 71 --------- .../musicSdk/kg/singer_20230609234507.js | 71 --------- .../musicSdk/kg/singer_20230609234515.js | 71 --------- .../musicSdk/kg/singer_20230609234527.js | 70 -------- .../musicSdk/kg/singer_20230609234802.js | 74 --------- .../musicSdk/kg/singer_20230609234808.js | 74 --------- .../musicSdk/kg/singer_20230609234837.js | 74 --------- .../musicSdk/kg/singer_20230609234843.js | 74 --------- .../musicSdk/kg/singer_20230609234902.js | 80 ---------- .../musicSdk/kg/singer_20230609234910.js | 80 ---------- .../musicSdk/kg/singer_20230609234918.js | 80 ---------- .../musicSdk/kg/singer_20230609234940.js | 86 ---------- .../musicSdk/wy/singer_20230609212734.js | 0 .../musicSdk/wy/singer_20230609212744.js | 3 - .../musicSdk/wy/singer_20230609212850.js | 5 - .../musicSdk/wy/singer_20230609212930.js | 8 - .../musicSdk/wy/singer_20230609212933.js | 7 - .../musicSdk/wy/singer_20230609213030.js | 7 - .../musicSdk/wy/singer_20230609213037.js | 8 - .../musicSdk/wy/singer_20230609213052.js | 8 - .../musicSdk/wy/singer_20230609213055.js | 6 - .../musicSdk/wy/singer_20230609213434.js | 9 -- .../musicSdk/wy/singer_20230609213452.js | 9 -- .../musicSdk/wy/singer_20230609213501.js | 11 -- .../musicSdk/wy/singer_20230609214136.js | 11 -- .../musicSdk/wy/singer_20230609214159.js | 11 -- .../musicSdk/wy/singer_20230609214211.js | 9 -- .../musicSdk/wy/singer_20230609214218.js | 8 - .../musicSdk/wy/singer_20230609214941.js | 14 -- .../musicSdk/wy/singer_20230609215009.js | 14 -- .../musicSdk/wy/singer_20230609215649.js | 14 -- .../musicSdk/wy/singer_20230609215657.js | 14 -- .../musicSdk/wy/singer_20230609215709.js | 14 -- .../musicSdk/wy/singer_20230609215719.js | 16 -- .../musicSdk/wy/singer_20230609215845.js | 19 --- .../musicSdk/wy/singer_20230609220016.js | 20 --- .../musicSdk/wy/singer_20230609220055.js | 21 --- .../musicSdk/wy/singer_20230609220127.js | 22 --- .../musicSdk/wy/singer_20230609220527.js | 23 --- .../musicSdk/wy/singer_20230609220534.js | 24 --- .../musicSdk/wy/singer_20230609220545.js | 23 --- .../musicSdk/wy/singer_20230609220605.js | 23 --- .../musicSdk/wy/singer_20230609220615.js | 24 --- .../musicSdk/wy/singer_20230609221125.js | 25 --- .../musicSdk/wy/singer_20230609221155.js | 27 ---- .../musicSdk/wy/singer_20230609221158.js | 26 --- .../musicSdk/wy/singer_20230609221240.js | 26 --- .../musicSdk/wy/singer_20230609221248.js | 26 --- .../musicSdk/wy/singer_20230609221303.js | 26 --- .../musicSdk/wy/singer_20230609221314.js | 26 --- .../musicSdk/wy/singer_20230609221326.js | 26 --- .../musicSdk/wy/singer_20230609221419.js | 26 --- .../musicSdk/wy/singer_20230609221422.js | 26 --- .../musicSdk/wy/singer_20230609221436.js | 26 --- .../musicSdk/wy/singer_20230609221847.js | 29 ---- .../musicSdk/wy/singer_20230609221916.js | 35 ---- .../musicSdk/wy/singer_20230609221957.js | 36 ----- .../musicSdk/wy/singer_20230609222018.js | 37 ----- .../musicSdk/wy/singer_20230609222227.js | 41 ----- .../musicSdk/wy/singer_20230609222449.js | 41 ----- .../musicSdk/wy/singer_20230609222504.js | 42 ----- .../musicSdk/wy/singer_20230609222523.js | 43 ----- .../musicSdk/wy/singer_20230609222543.js | 43 ----- .../musicSdk/wy/singer_20230609222828.js | 48 ------ .../musicSdk/wy/singer_20230609222834.js | 48 ------ .../musicSdk/wy/singer_20230609222837.js | 48 ------ .../musicSdk/wy/singer_20230609223044.js | 48 ------ .../musicSdk/wy/singer_20230609223335.js | 50 ------ .../musicSdk/wy/singer_20230609223338.js | 48 ------ .../musicSdk/wy/singer_20230609223350.js | 49 ------ .../musicSdk/wy/singer_20230609223400.js | 50 ------ .../musicSdk/wy/singer_20230609223403.js | 49 ------ .../musicSdk/wy/singer_20230609223442.js | 50 ------ .../musicSdk/wy/singer_20230609223446.js | 50 ------ .../musicSdk/wy/singer_20230609223552.js | 66 -------- .../musicSdk/wy/singer_20230609223554.js | 66 -------- .../musicSdk/wy/singer_20230609223604.js | 67 -------- .../musicSdk/wy/singer_20230609223619.js | 68 -------- .../musicSdk/wy/singer_20230609223622.js | 68 -------- .../musicSdk/wy/singer_20230609223634.js | 69 -------- .../musicSdk/wy/singer_20230609223639.js | 70 -------- .../musicSdk/wy/singer_20230609223641.js | 70 -------- .../musicSdk/wy/singer_20230609223656.js | 71 --------- .../musicSdk/wy/singer_20230609223733.js | 76 --------- .../musicSdk/wy/singer_20230609223747.js | 77 --------- .../musicSdk/wy/singer_20230609223753.js | 78 --------- .../musicSdk/wy/singer_20230609223816.js | 94 ----------- .../musicSdk/wy/singer_20230609223823.js | 93 ----------- .../musicSdk/wy/singer_20230609223827.js | 92 ----------- .../musicSdk/wy/singer_20230609224031.js | 98 ------------ .../musicSdk/wy/singer_20230609224036.js | 98 ------------ .../musicSdk/wy/singer_20230609224056.js | 98 ------------ .../musicSdk/wy/singer_20230609224110.js | 98 ------------ .../musicSdk/wy/singer_20230609224136.js | 98 ------------ .../musicSdk/wy/singer_20230609224159.js | 98 ------------ .../musicSdk/wy/singer_20230609224216.js | 98 ------------ .../musicSdk/wy/singer_20230609224229.js | 98 ------------ .../musicSdk/wy/singer_20230609224359.js | 98 ------------ .../musicSdk/wy/singer_20230609224416.js | 98 ------------ .../musicSdk/wy/singer_20230609224418.js | 98 ------------ .../musicSdk/wy/singer_20230609224432.js | 98 ------------ .../musicSdk/wy/singer_20230609224457.js | 99 ------------ .../musicSdk/wy/singer_20230609224519.js | 99 ------------ .../musicSdk/wy/singer_20230609224547.js | 99 ------------ .../musicSdk/wy/singer_20230609224621.js | 99 ------------ .../musicSdk/wy/singer_20230609224651.js | 99 ------------ .../musicSdk/wy/singer_20230609224705.js | 99 ------------ .../musicSdk/wy/singer_20230609224959.js | 100 ------------ .../musicSdk/wy/singer_20230609225008.js | 100 ------------ .../musicSdk/wy/singer_20230609225015.js | 100 ------------ .../musicSdk/wy/singer_20230609225029.js | 99 ------------ .../musicSdk/wy/singer_20230609225557.js | 99 ------------ .../musicSdk/wy/singer_20230609225623.js | 99 ------------ .../musicSdk/wy/singer_20230609225628.js | 99 ------------ .../musicSdk/wy/singer_20230609225739.js | 102 ------------ .../musicSdk/wy/singer_20230609225749.js | 102 ------------ .../musicSdk/wy/singer_20230609225803.js | 108 ------------- .../musicSdk/wy/singer_20230609225956.js | 116 -------------- .../musicSdk/wy/singer_20230609230028.js | 115 -------------- .../musicSdk/wy/singer_20230609230036.js | 115 -------------- .../musicSdk/wy/singer_20230609230053.js | 115 -------------- .../musicSdk/wy/singer_20230609230116.js | 115 -------------- .../musicSdk/wy/singer_20230609230133.js | 118 -------------- .../musicSdk/wy/singer_20230609230135.js | 118 -------------- .../musicSdk/wy/singer_20230609230201.js | 122 -------------- .../musicSdk/wy/singer_20230609230241.js | 122 -------------- .../musicSdk/wy/singer_20230609230313.js | 124 --------------- .../musicSdk/wy/singer_20230609230317.js | 122 -------------- .../musicSdk/wy/singer_20230609230344.js | 129 --------------- .../musicSdk/wy/singer_20230609230357.js | 130 --------------- .../musicSdk/wy/singer_20230609230431.js | 131 --------------- .../musicSdk/wy/singer_20230609230456.js | 132 ---------------- .../musicSdk/wy/singer_20230609230656.js | 132 ---------------- .../musicSdk/wy/singer_20230609230702.js | 131 --------------- .../musicSdk/wy/singer_20230609230727.js | 132 ---------------- .../musicSdk/wy/singer_20230609230734.js | 132 ---------------- .../musicSdk/wy/singer_20230609232004.js | 133 ---------------- .../musicSdk/wy/singer_20230609232819.js | 135 ---------------- .../musicSdk/wy/singer_20230609232854.js | 141 ----------------- .../musicSdk/wy/singer_20230609232950.js | 141 ----------------- .../musicSdk/wy/singer_20230609232952.js | 141 ----------------- .../musicSdk/wy/singer_20230609234543.js | 143 ----------------- .../musicSdk/wy/singer_20230609234610.js | 148 ----------------- .../musicSdk/wy/singer_20230609234742.js | 149 ------------------ .../musicSdk/wy/utils/index_20230521134626.js | 22 --- .../musicSdk/wy/utils/index_20230609213722.js | 49 ------ .../musicSdk/wy/utils/index_20230609213741.js | 48 ------ .../musicSdk/wy/utils/index_20230609213807.js | 43 ----- .../musicSdk/wy/utils/index_20230609213814.js | 43 ----- .../musicSdk/wy/utils/index_20230609213832.js | 42 ----- .../musicSdk/wy/utils/index_20230609214124.js | 22 --- .../musicSdk/wy/utils/index_20230609215059.js | 49 ------ .../musicSdk/wy/utils/index_20230609215140.js | 49 ------ .../musicSdk/wy/utils/index_20230609215240.js | 50 ------ .../musicSdk/wy/utils/index_20230609215413.js | 63 -------- .../musicSdk/wy/utils/index_20230609215428.js | 63 -------- .../musicSdk/wy/utils/index_20230609215435.js | 62 -------- .../musicSdk/wy/utils/index_20230609215438.js | 61 ------- .../musicSdk/wy/utils/index_20230609215445.js | 61 ------- .../musicSdk/wy/utils/index_20230609215451.js | 61 ------- .../musicSdk/wy/utils/index_20230609215506.js | 61 ------- .../musicSdk/wy/utils/index_20230609215510.js | 62 -------- .../musicSdk/wy/utils/index_20230609215513.js | 62 -------- .../musicSdk/wy/utils/index_20230609215535.js | 57 ------- .../musicSdk/wy/utils/index_20230609215546.js | 57 ------- .../musicSdk/wy/utils/index_20230609215557.js | 56 ------- .../musicSdk/wy/utils/index_20230609215601.js | 56 ------- .../musicSdk/wy/utils/index_20230609215616.js | 56 ------- .../musicSdk/wy/utils/index_20230609215628.js | 56 ------- .../musicSdk/wy/utils/index_20230609215641.js | 56 ------- .../musicSdk/wy/utils/index_20230609224836.js | 64 -------- .../musicSdk/wy/utils/index_20230609224839.js | 64 -------- .../musicSdk/wy/utils/index_20230609224855.js | 56 ------- 228 files changed, 15153 deletions(-) delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609203128.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230828.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230857.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230914.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230921.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230937.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230943.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230950.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609230955.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231029.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231127.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231135.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231520.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231538.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231555.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231558.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231618.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231649.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231657.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231707.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231721.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609231724.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232058.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232241.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232451.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232500.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232526.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232530.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232532.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232535.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232556.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232738.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232741.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232752.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609232804.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609233005.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609233020.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609233027.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609233257.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609233415.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609233553.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609233623.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234004.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234010.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234014.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234022.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234034.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234146.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234208.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234242.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234304.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234309.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234337.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234401.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234433.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234447.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234507.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234515.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234527.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234802.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234808.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234837.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234843.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234902.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234910.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234918.js delete mode 100644 .history/src/renderer/utils/musicSdk/kg/singer_20230609234940.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609212734.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609212744.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609212850.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609212930.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609212933.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609213030.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609213037.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609213052.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609213055.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609213434.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609213452.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609213501.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609214136.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609214159.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609214211.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609214218.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609214941.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609215009.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609215649.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609215657.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609215709.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609215719.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609215845.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220016.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220055.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220127.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220527.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220534.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220545.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220605.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609220615.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221125.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221155.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221158.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221240.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221248.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221303.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221314.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221326.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221419.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221422.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221436.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221847.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221916.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609221957.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222018.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222227.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222449.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222504.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222523.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222543.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222828.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222834.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609222837.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223044.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223335.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223338.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223350.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223400.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223403.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223442.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223446.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223552.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223554.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223604.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223619.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223622.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223634.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223639.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223641.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223656.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223733.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223747.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223753.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223816.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223823.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609223827.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224031.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224036.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224056.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224110.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224136.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224159.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224216.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224229.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224359.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224416.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224418.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224432.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224457.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224519.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224547.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224621.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224651.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224705.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609224959.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225008.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225015.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225029.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225557.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225623.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225628.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225739.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225749.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225803.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609225956.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230028.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230036.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230053.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230116.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230133.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230135.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230201.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230241.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230313.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230317.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230344.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230357.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230431.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230456.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230656.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230702.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230727.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609230734.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609232004.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609232819.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609232854.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609232950.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609232952.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609234543.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609234610.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/singer_20230609234742.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230521134626.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609213722.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609213741.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609213807.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609213814.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609213832.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609214124.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215059.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215140.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215240.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215413.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215428.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215435.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215438.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215445.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215451.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215506.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215510.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215513.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215535.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215546.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215557.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215601.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215616.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215628.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609215641.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609224836.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609224839.js delete mode 100644 .history/src/renderer/utils/musicSdk/wy/utils/index_20230609224855.js diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609203128.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609203128.js deleted file mode 100644 index b2f9394e..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609203128.js +++ /dev/null @@ -1,59 +0,0 @@ -import { httpFetch } from '../../request' -// import { decodeName, formatPlayTime, sizeFormate } from '../../index' -// import { signatureParams } from './util' -import { getMusicInfosByList } from './musicInfo' - -export default { - filterAlbum(rawList) { - let returnList = [] - rawList.forEach((albumInfo) => { - returnList.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - }, - async getSingerInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSingerSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getSingerAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, -} diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230828.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230828.js deleted file mode 100644 index 3c4df863..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230828.js +++ /dev/null @@ -1,60 +0,0 @@ -import { httpFetch } from '../../request' -// import { decodeName, formatPlayTime, sizeFormate } from '../../index' -// import { signatureParams } from './util' -import { getMusicInfosByList } from './musicInfo' - -export default { - filterAlbum(rawList) { - const list = [] - rawList.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, - async getSingerInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSingerSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getSingerAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, -} diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230857.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230857.js deleted file mode 100644 index caef18a2..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230857.js +++ /dev/null @@ -1,58 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' - -export default { - filterAlbum(rawList) { - const list = [] - rawList.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, - async getSingerInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSingerSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getSingerAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, -} diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230914.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230914.js deleted file mode 100644 index 20366d54..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230914.js +++ /dev/null @@ -1,58 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' - -export default { - async getSingerInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSingerSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getSingerAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(rawList) { - const list = [] - rawList.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230921.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230921.js deleted file mode 100644 index 91aa69e0..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230921.js +++ /dev/null @@ -1,59 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' - -export default { - async getSingerInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSingerSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getSingerAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230937.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230937.js deleted file mode 100644 index 2376dc3f..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230937.js +++ /dev/null @@ -1,59 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' - -export default { - async getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230943.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230943.js deleted file mode 100644 index af3773cc..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230943.js +++ /dev/null @@ -1,60 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' - -export default { - async getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230950.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230950.js deleted file mode 100644 index 2c37ecc8..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230950.js +++ /dev/null @@ -1,62 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' - -export default { - async getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230955.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609230955.js deleted file mode 100644 index 2c37ecc8..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609230955.js +++ /dev/null @@ -1,62 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' - -export default { - async getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231029.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231029.js deleted file mode 100644 index 01690e11..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231029.js +++ /dev/null @@ -1,63 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - async getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231127.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231127.js deleted file mode 100644 index 2a193689..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231127.js +++ /dev/null @@ -1,67 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - async getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231135.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231135.js deleted file mode 100644 index 32932a27..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231135.js +++ /dev/null @@ -1,70 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - async getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - - } - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231520.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231520.js deleted file mode 100644 index 89e5e754..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231520.js +++ /dev/null @@ -1,80 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - async getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231538.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231538.js deleted file mode 100644 index 91de8066..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231538.js +++ /dev/null @@ -1,80 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - async getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231555.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231555.js deleted file mode 100644 index 4b149dad..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231555.js +++ /dev/null @@ -1,80 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - async getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 48-), - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231558.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231558.js deleted file mode 100644 index d38dbc35..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231558.js +++ /dev/null @@ -1,80 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - async getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231618.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231618.js deleted file mode 100644 index 83ade402..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231618.js +++ /dev/null @@ -1,80 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - async getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231649.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231649.js deleted file mode 100644 index 9ca544c0..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231649.js +++ /dev/null @@ -1,80 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - async getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.artist.albumSize, - } - } - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231657.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231657.js deleted file mode 100644 index cb6b6c23..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231657.js +++ /dev/null @@ -1,80 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - async getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231707.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231707.js deleted file mode 100644 index a6b0e1f8..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231707.js +++ /dev/null @@ -1,81 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - async getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手信息失败') - return { - source: 'kg', - singerid, - info: { - name: body.data.singername, - desc: body.data.intro, - img: body.data.imgurl.replace('{size}', '480'), - }, - } - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231721.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231721.js deleted file mode 100644 index eb185fc9..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231721.js +++ /dev/null @@ -1,68 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231724.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609231724.js deleted file mode 100644 index f9113f77..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609231724.js +++ /dev/null @@ -1,67 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232058.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232058.js deleted file mode 100644 index 6eb7e107..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232058.js +++ /dev/null @@ -1,67 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232241.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232241.js deleted file mode 100644 index fbdea121..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232241.js +++ /dev/null @@ -1,71 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - const list = getMusicInfosByList(body.data.info) - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232451.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232451.js deleted file mode 100644 index 63e5d4a7..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232451.js +++ /dev/null @@ -1,70 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - const list = getMusicInfosByList(body.data.info) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败') - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232500.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232500.js deleted file mode 100644 index 7ed93373..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232500.js +++ /dev/null @@ -1,67 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - const list = getMusicInfosByList(body.data.info) - - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232526.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232526.js deleted file mode 100644 index 1fe0e427..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232526.js +++ /dev/null @@ -1,68 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.data.info) throw new Error('get singer song list faild.') - const list = getMusicInfosByList(body.data.info) - - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232530.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232530.js deleted file mode 100644 index 98351381..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232530.js +++ /dev/null @@ -1,69 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.data.info) throw new Error('get singer song list faild.') - - const list = getMusicInfosByList(body.data.info) - - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232532.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232532.js deleted file mode 100644 index 9a75b47f..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232532.js +++ /dev/null @@ -1,69 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.data.info) throw new Error('get singer song list faild.') - - const list = getMusicInfosByList(body.data.info) - - let listData = await getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232535.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232535.js deleted file mode 100644 index 26d0304d..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232535.js +++ /dev/null @@ -1,67 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.data.info) throw new Error('get singer song list faild.') - - const list = getMusicInfosByList(body.data.info) - return { - source: 'kg', - list: listData, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232556.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232556.js deleted file mode 100644 index 041cabb8..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232556.js +++ /dev/null @@ -1,67 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.data.info) throw new Error('get singer song list faild.') - - const list = getMusicInfosByList(body.data.info) - return { - source: 'kg', - list, - id: `kg__singer_${singerid}`, - singerid, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232738.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232738.js deleted file mode 100644 index 10b11045..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232738.js +++ /dev/null @@ -1,66 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.data.info) throw new Error('get singer song list faild.') - - const list = getMusicInfosByList(body.data.info) - return { - source: 'kg', - list, - limit, - total: body.data.total, - allPage: Math.ceil(body.data.total / limit), - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232741.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232741.js deleted file mode 100644 index 537e473a..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232741.js +++ /dev/null @@ -1,65 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.data.info) throw new Error('get singer song list faild.') - - const list = getMusicInfosByList(body.data.info) - return { - source: 'kg', - list, - limit, - total: body.data.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232752.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232752.js deleted file mode 100644 index 244eb14f..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232752.js +++ /dev/null @@ -1,66 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.data.info) throw new Error('get singer song list faild.') - - const list = getMusicInfosByList(body.data.info) - return { - source: 'kg', - list, - limit, - page, - total: body.data.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232804.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609232804.js deleted file mode 100644 index 9a90048a..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609232804.js +++ /dev/null @@ -1,66 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233005.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233005.js deleted file mode 100644 index 7924a39c..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233005.js +++ /dev/null @@ -1,65 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233020.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233020.js deleted file mode 100644 index 04dac6b2..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233020.js +++ /dev/null @@ -1,67 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233027.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233027.js deleted file mode 100644 index 8a5818a1..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233027.js +++ /dev/null @@ -1,67 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233257.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233257.js deleted file mode 100644 index 0ff7e4d9..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233257.js +++ /dev/null @@ -1,67 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233415.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233415.js deleted file mode 100644 index d1d0e350..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233415.js +++ /dev/null @@ -1,71 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233553.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233553.js deleted file mode 100644 index 8b69d714..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233553.js +++ /dev/null @@ -1,71 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233623.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609233623.js deleted file mode 100644 index ca074587..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609233623.js +++ /dev/null @@ -1,71 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - const list = this.filterAlbumList(body.info) - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234004.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234004.js deleted file mode 100644 index 28a2509b..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234004.js +++ /dev/null @@ -1,73 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - const list = this.filterAlbumList(body.info) - return {} - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234010.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234010.js deleted file mode 100644 index c49cb903..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234010.js +++ /dev/null @@ -1,74 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return {} - }) - - const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`) - let { body, statusCode } = await requestObj.promise - if (statusCode !== 200) throw new Error('获取歌手专辑列表失败') - return { - source: 'kg', - albums: this.filterAlbum(body.data.info), - singerid, - } - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234014.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234014.js deleted file mode 100644 index 6c2423f9..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234014.js +++ /dev/null @@ -1,65 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return {} - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234022.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234022.js deleted file mode 100644 index 80582fe2..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234022.js +++ /dev/null @@ -1,62 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return {} - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234034.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234034.js deleted file mode 100644 index dbc09ed1..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234034.js +++ /dev/null @@ -1,63 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return {} - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach((albumInfo) => { - list.push({ - name: albumInfo.albumname, - author: albumInfo.singername, - img: albumInfo.replaceAll('{size}', '480'), - album_id: albumInfo.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234146.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234146.js deleted file mode 100644 index eea5d1b3..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234146.js +++ /dev/null @@ -1,63 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return {} - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - list.push({ - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - album_id: item.albumid, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234208.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234208.js deleted file mode 100644 index cff8f4e7..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234208.js +++ /dev/null @@ -1,66 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return {} - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - list.push({ - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - album_id: item.albumid, - }, - - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234242.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234242.js deleted file mode 100644 index d78b26d5..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234242.js +++ /dev/null @@ -1,65 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return {} - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - list.push({ - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - album_id: item.albumid, - }, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234304.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234304.js deleted file mode 100644 index 6e0cf134..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234304.js +++ /dev/null @@ -1,66 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return {} - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - list.push({ - id: item.albumid, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item. - }, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234309.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234309.js deleted file mode 100644 index 87b5d040..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234309.js +++ /dev/null @@ -1,66 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return {} - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - list.push({ - id: item.albumid, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234337.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234337.js deleted file mode 100644 index 59cf7d94..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234337.js +++ /dev/null @@ -1,67 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return {} - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - list.push({ - id: item.albumid, - count: item.songcount, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - }) - }) - return list - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234401.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234401.js deleted file mode 100644 index 975bd582..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234401.js +++ /dev/null @@ -1,65 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return {} - }) - }, - filterAlbumList(raw) { - return raw.map(item => { - return { - id: item.albumid, - count: item.songcount, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - } - }) - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234433.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234433.js deleted file mode 100644 index edff5106..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234433.js +++ /dev/null @@ -1,71 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body. - } - }) - }, - filterAlbumList(raw) { - return raw.map(item => { - return { - id: item.albumid, - count: item.songcount, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - } - }) - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234447.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234447.js deleted file mode 100644 index f2fdfa16..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234447.js +++ /dev/null @@ -1,71 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - async getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }) - }, - filterAlbumList(raw) { - return raw.map(item => { - return { - id: item.albumid, - count: item.songcount, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - } - }) - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234507.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234507.js deleted file mode 100644 index c19a38ac..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234507.js +++ /dev/null @@ -1,71 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }) - }, - filterAlbumList(raw) { - return raw.map(item => { - return { - id: item.albumid, - count: item.songcount, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - } - }) - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234515.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234515.js deleted file mode 100644 index 3b20b17a..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234515.js +++ /dev/null @@ -1,71 +0,0 @@ -import { httpFetch } from '../../request' -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - filterAlbumList(raw) { - return raw.map(item => { - return { - id: item.albumid, - count: item.songcount, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - } - }) - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234527.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234527.js deleted file mode 100644 index f3007e96..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234527.js +++ /dev/null @@ -1,70 +0,0 @@ -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - filterAlbumList(raw) { - return raw.map(item => { - return { - id: item.albumid, - count: item.songcount, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - } - }) - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234802.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234802.js deleted file mode 100644 index 9a49b2b7..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234802.js +++ /dev/null @@ -1,74 +0,0 @@ -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - filterAlbumList(raw) { - return raw.map(item => { - return { - id: item.albumid, - count: item.songcount, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - } - }) - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234808.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234808.js deleted file mode 100644 index 0cc63725..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234808.js +++ /dev/null @@ -1,74 +0,0 @@ -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(singerid) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - filterAlbumList(raw) { - return raw.map(item => { - return { - id: item.albumid, - count: item.songcount, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - } - }) - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234837.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234837.js deleted file mode 100644 index c96c145c..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234837.js +++ /dev/null @@ -1,74 +0,0 @@ -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - filterAlbumList(raw) { - return raw.map(item => { - return { - id: item.albumid, - count: item.songcount, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - } - }) - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234843.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234843.js deleted file mode 100644 index bc724cec..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234843.js +++ /dev/null @@ -1,74 +0,0 @@ -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - if (id == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${id}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - filterAlbumList(raw) { - return raw.map(item => { - return { - id: item.albumid, - count: item.songcount, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - } - }) - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234902.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234902.js deleted file mode 100644 index 3f0b73fa..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234902.js +++ /dev/null @@ -1,80 +0,0 @@ -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - if (id == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${id}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} singerid - * @param {*} page - * @param {*} limit - */ - getAlbumList(singerid, page, limit) { - if (singerid == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${singerid}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - filterAlbumList(raw) { - return raw.map(item => { - return { - id: item.albumid, - count: item.songcount, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - } - }) - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234910.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234910.js deleted file mode 100644 index ce1e072b..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234910.js +++ /dev/null @@ -1,80 +0,0 @@ -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - if (id == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${id}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page, limit) { - if (id == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${id}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }) - }, - async getSongList(singerid, page = 1, limit = 100) { - if (singerid == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - filterAlbumList(raw) { - return raw.map(item => { - return { - id: item.albumid, - count: item.songcount, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - } - }) - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234918.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234918.js deleted file mode 100644 index ab26d60a..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234918.js +++ /dev/null @@ -1,80 +0,0 @@ -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - if (id == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${id}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page, limit) { - if (id == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${id}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }) - }, - async getSongList(id, page = 1, limit = 100) { - if (id == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${id}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - filterAlbumList(raw) { - return raw.map(item => { - return { - id: item.albumid, - count: item.songcount, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - } - }) - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234940.js b/.history/src/renderer/utils/musicSdk/kg/singer_20230609234940.js deleted file mode 100644 index 47ea1600..00000000 --- a/.history/src/renderer/utils/musicSdk/kg/singer_20230609234940.js +++ /dev/null @@ -1,86 +0,0 @@ -import { getMusicInfosByList } from './musicInfo' -import { createHttpFetch } from './util' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - if (id == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0 - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${id}`).then(body => { - if (!body) throw new Error('get singer info faild.') - - return { - source: 'kg', - id: body.singerid, - info: { - name: body.singername, - desc: body.intro, - avatar: body.imgurl.replace('{size}', 480), - gender: body.grade === 1 ? '1' : '2', - }, - count: { - music: body.songcount, - album: body.albumcount, - } - } - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page, limit) { - if (id == 0) throw new Error('歌手不存在') - return createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/album?singerid=${id}&page=${page}&pagesize=${limit}`).then(body => { - if (!body.info) throw new Error('get singer album faild.') - - const list = this.filterAlbumList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (id == 0) throw new Error('歌手不存在') - const body = await createHttpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${id}&page=${page}&pagesize=${limit}`) - if (!body.info) throw new Error('get singer song list faild.') - - const list = await getMusicInfosByList(body.info) - return { - source: 'kg', - list, - limit, - page, - total: body.total, - } - }, - filterAlbumList(raw) { - return raw.map(item => { - return { - id: item.albumid, - count: item.songcount, - info: { - name: item.albumname, - author: item.singername, - img: item.replaceAll('{size}', '480'), - desc: item.intro, - }, - } - }) - }, -} - diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609212734.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609212734.js deleted file mode 100644 index e69de29b..00000000 diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609212744.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609212744.js deleted file mode 100644 index 994a3a4f..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609212744.js +++ /dev/null @@ -1,3 +0,0 @@ -export default{ - -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609212850.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609212850.js deleted file mode 100644 index cca076d1..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609212850.js +++ /dev/null @@ -1,5 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default{ - -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609212930.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609212930.js deleted file mode 100644 index b9aa3f42..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609212930.js +++ /dev/null @@ -1,8 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default { - async getInfo(){ - - } - -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609212933.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609212933.js deleted file mode 100644 index b5418364..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609212933.js +++ /dev/null @@ -1,7 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default { - async getInfo(){ - - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213030.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213030.js deleted file mode 100644 index bea8bc10..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213030.js +++ /dev/null @@ -1,7 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default { - async getInfo(id){ - - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213037.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213037.js deleted file mode 100644 index 3ebc016c..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213037.js +++ /dev/null @@ -1,8 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default { - async getInfo(id){ - - - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213052.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213052.js deleted file mode 100644 index 2f77bc78..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213052.js +++ /dev/null @@ -1,8 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default { - getInfo(id){ - - - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213055.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213055.js deleted file mode 100644 index 4ae59364..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213055.js +++ /dev/null @@ -1,6 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default { - getInfo(id){ - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213434.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213434.js deleted file mode 100644 index 10eb62c3..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213434.js +++ /dev/null @@ -1,9 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default { - getInfo(id){ - return eapiRequest("/api/artist/head/info/get", { - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213452.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213452.js deleted file mode 100644 index d740c45c..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213452.js +++ /dev/null @@ -1,9 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default { - getInfo(id){ - return eapiRequest("/api/artist/head/info/get", { - id: 1143033, - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213501.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609213501.js deleted file mode 100644 index 3317cb89..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609213501.js +++ /dev/null @@ -1,11 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default { - getInfo(id){ - return eapiRequest("/api/artist/head/info/get", { - id: 1143033, - }).then(body => { - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609214136.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609214136.js deleted file mode 100644 index 52b1acda..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609214136.js +++ /dev/null @@ -1,11 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default { - getInfo(id){ - return eapiRequest("/api/artist/head/info/get", { - id: 1143033, - }).then(({ body }) => { - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609214159.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609214159.js deleted file mode 100644 index ea546515..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609214159.js +++ /dev/null @@ -1,11 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default { - async getInfo(id){ - const request = await eapiRequest("/api/artist/head/info/get", { - id: 1143033, - }).then(({ body }) => { - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609214211.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609214211.js deleted file mode 100644 index 1feed600..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609214211.js +++ /dev/null @@ -1,9 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default { - async getInfo(id){ - const request = await eapiRequest("/api/artist/head/info/get", { id: 1143033 }).then(({ body }) => { - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609214218.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609214218.js deleted file mode 100644 index 8008135b..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609214218.js +++ /dev/null @@ -1,8 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default { - async getInfo(id){ - const request = await eapiRequest("/api/artist/head/info/get", { id: 1143033 }) - - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609214941.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609214941.js deleted file mode 100644 index f94b8481..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609214941.js +++ /dev/null @@ -1,14 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - * @returns - */ - async getInfo(id){ - return eapiRequest("/api/artist/head/info/get", { id: 1143033 }).then(({ body }) => { - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215009.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215009.js deleted file mode 100644 index 4da10a09..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215009.js +++ /dev/null @@ -1,14 +0,0 @@ -import { eapiRequest } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - * @returns - */ - async getInfo(id){ - return eapiRequest("/api/artist/head/info/get", { id }).then(({ body }) => { - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215649.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215649.js deleted file mode 100644 index 0fb79565..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215649.js +++ /dev/null @@ -1,14 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - * @returns - */ - async getInfo(id){ - return eapiRequest("/api/artist/head/info/get", { id }).then(({ body }) => { - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215657.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215657.js deleted file mode 100644 index 46e07f4f..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215657.js +++ /dev/null @@ -1,14 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - * @returns - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(({ body }) => { - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215709.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215709.js deleted file mode 100644 index 5a5c36c5..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215709.js +++ /dev/null @@ -1,14 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - * @returns - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215719.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215719.js deleted file mode 100644 index daba54b5..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215719.js +++ /dev/null @@ -1,16 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - * @returns - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - return { - source: 'wy' - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215845.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609215845.js deleted file mode 100644 index e4c2a8cb..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609215845.js +++ /dev/null @@ -1,19 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - * @returns - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - return { - source: 'wy', - info: { - desc: - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220016.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220016.js deleted file mode 100644 index 3e29cddf..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220016.js +++ /dev/null @@ -1,20 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - * @returns - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - return { - source: 'wy', - musicTotal: "", - info: { - desc: "", - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220055.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220055.js deleted file mode 100644 index b8a3bc7d..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220055.js +++ /dev/null @@ -1,21 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - * @returns - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - return { - source: 'wy', - musicTotal: "", - info: { - name: "", - desc: "", - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220127.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220127.js deleted file mode 100644 index eb566ea2..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220127.js +++ /dev/null @@ -1,22 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - * @returns - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - return { - source: 'wy', - musicTotal: "", - info: { - name: "", - desc: "", - avatar: "", - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220527.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220527.js deleted file mode 100644 index ec1dc0f2..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220527.js +++ /dev/null @@ -1,23 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - * @returns - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - musicTotal: "", - info: { - name: "", - desc: "", - avatar: "", - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220534.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220534.js deleted file mode 100644 index 6f01511f..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220534.js +++ /dev/null @@ -1,24 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - * @returns - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - - return { - source: 'wy', - musicTotal: "", - info: { - name: "", - desc: "", - avatar: "", - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220545.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220545.js deleted file mode 100644 index 1035077c..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220545.js +++ /dev/null @@ -1,23 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - - return { - source: 'wy', - musicTotal: "", - info: { - name: "", - desc: "", - avatar: "", - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220605.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220605.js deleted file mode 100644 index 2394b9b7..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220605.js +++ /dev/null @@ -1,23 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - - return { - source: 'wy', - info: { - name: "", - desc: "", - avatar: "", - musicCount: 111, - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220615.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609220615.js deleted file mode 100644 index 85327aa2..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609220615.js +++ /dev/null @@ -1,24 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - - return { - source: 'wy', - info: { - name: "", - desc: "", - avatar: "", - musicCount: 111, - albumCount: 111, - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221125.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221125.js deleted file mode 100644 index 7cd0adab..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221125.js +++ /dev/null @@ -1,25 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - - return { - source: 'wy', - info: { - name: "", - desc: "", - avatar: "", - gender: "", - musicCount: 111, - albumCount: 111, - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221155.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221155.js deleted file mode 100644 index 7e38699f..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221155.js +++ /dev/null @@ -1,27 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - - return { - source: 'wy', - info: { - name: "", - desc: "", - avatar: "", - gender: 1, - }, - count: { - music: 111, - album: 111, - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221158.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221158.js deleted file mode 100644 index 319a77a7..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221158.js +++ /dev/null @@ -1,26 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: "", - desc: "", - avatar: "", - gender: 1, - }, - count: { - music: 111, - album: 111, - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221240.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221240.js deleted file mode 100644 index 707602ae..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221240.js +++ /dev/null @@ -1,26 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: "", - desc: body.artist, - avatar: "", - gender: 1, - }, - count: { - music: 111, - album: 111, - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221248.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221248.js deleted file mode 100644 index 5a9af67f..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221248.js +++ /dev/null @@ -1,26 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: "", - desc: body.artist.briefDesc, - avatar: "", - gender: 1, - }, - count: { - music: 111, - album: 111, - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221303.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221303.js deleted file mode 100644 index 7feaed21..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221303.js +++ /dev/null @@ -1,26 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: "", - gender: 1, - }, - count: { - music: 111, - album: 111, - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221314.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221314.js deleted file mode 100644 index 6c27b8f5..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221314.js +++ /dev/null @@ -1,26 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: "", - gender: 1, - }, - count: { - music: body.artist, - album: body.artist, - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221326.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221326.js deleted file mode 100644 index 16df8e1c..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221326.js +++ /dev/null @@ -1,26 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: "", - gender: 1, - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221419.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221419.js deleted file mode 100644 index f809e06f..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221419.js +++ /dev/null @@ -1,26 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: "", - gender: body.user.gender === 1 ? '1' : "2", - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221422.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221422.js deleted file mode 100644 index 34ea7664..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221422.js +++ /dev/null @@ -1,26 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: "", - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221436.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221436.js deleted file mode 100644 index 9a28f0da..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221436.js +++ /dev/null @@ -1,26 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221847.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221847.js deleted file mode 100644 index d15d2868..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221847.js +++ /dev/null @@ -1,29 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - async getSongList(){ - - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221916.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221916.js deleted file mode 100644 index 1cd75889..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221916.js +++ /dev/null @@ -1,35 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page, limit){ - - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221957.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609221957.js deleted file mode 100644 index 48619cf5..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609221957.js +++ /dev/null @@ -1,36 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch("/api/artist/head/info/get", { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page, limit){ - return createEapiFetch('/api/v2/artist/songs', { id, limit}) - - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222018.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222018.js deleted file mode 100644 index 8a439873..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222018.js +++ /dev/null @@ -1,37 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page, limit){ - return createEapiFetch('/api/v2/artist/songs', { id, limit }).then(body => { - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222227.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222227.js deleted file mode 100644 index e34d8e75..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222227.js +++ /dev/null @@ -1,41 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page, limit){ - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222449.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222449.js deleted file mode 100644 index 3b17fa1b..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222449.js +++ /dev/null @@ -1,41 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100){ - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222504.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222504.js deleted file mode 100644 index e8aec950..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222504.js +++ /dev/null @@ -1,42 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100){ - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222523.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222523.js deleted file mode 100644 index 081eaf64..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222523.js +++ /dev/null @@ -1,43 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100){ - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer info faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222543.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222543.js deleted file mode 100644 index 76aac108..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222543.js +++ /dev/null @@ -1,43 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100){ - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222828.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222828.js deleted file mode 100644 index 10695569..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222828.js +++ /dev/null @@ -1,48 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw){ - raw.map(item => { - - }) - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100){ - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222834.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222834.js deleted file mode 100644 index 60f2c9da..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222834.js +++ /dev/null @@ -1,48 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - raw.map(item => { - - }) - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id){ - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100){ - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222837.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609222837.js deleted file mode 100644 index 4da04355..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609222837.js +++ /dev/null @@ -1,48 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - raw.map(item => { - - }) - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223044.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223044.js deleted file mode 100644 index 4da04355..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223044.js +++ /dev/null @@ -1,48 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - raw.map(item => { - - }) - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223335.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223335.js deleted file mode 100644 index 2b6c89cc..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223335.js +++ /dev/null @@ -1,50 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - raw.array.forEach(element => { - - });(item => { - - }) - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223338.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223338.js deleted file mode 100644 index 63147edf..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223338.js +++ /dev/null @@ -1,48 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - raw.forEach(item => { - - }) - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223350.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223350.js deleted file mode 100644 index 3a3de7e7..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223350.js +++ /dev/null @@ -1,49 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - - }) - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223400.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223400.js deleted file mode 100644 index e3f07de6..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223400.js +++ /dev/null @@ -1,50 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - const ids = new Set() - raw.forEach(item => { - - }) - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223403.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223403.js deleted file mode 100644 index 3a3de7e7..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223403.js +++ /dev/null @@ -1,49 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - - }) - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223442.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223442.js deleted file mode 100644 index 85ae3ba0..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223442.js +++ /dev/null @@ -1,50 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - }) - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223446.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223446.js deleted file mode 100644 index aa686ee1..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223446.js +++ /dev/null @@ -1,50 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - }) - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223552.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223552.js deleted file mode 100644 index ca3fecd2..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223552.js +++ /dev/null @@ -1,66 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223554.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223554.js deleted file mode 100644 index c5c9bf51..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223554.js +++ /dev/null @@ -1,66 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223604.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223604.js deleted file mode 100644 index 014768c5..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223604.js +++ /dev/null @@ -1,67 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223619.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223619.js deleted file mode 100644 index 62543c32..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223619.js +++ /dev/null @@ -1,68 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - const types = [] - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223622.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223622.js deleted file mode 100644 index 5a3da1d4..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223622.js +++ /dev/null @@ -1,68 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - const types = {} - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223634.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223634.js deleted file mode 100644 index ddb6de5a..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223634.js +++ /dev/null @@ -1,69 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - const types = [] - const _types = {} - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223639.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223639.js deleted file mode 100644 index eb372569..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223639.js +++ /dev/null @@ -1,70 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223641.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223641.js deleted file mode 100644 index c92fd173..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223641.js +++ /dev/null @@ -1,70 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223656.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223656.js deleted file mode 100644 index 09694480..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223656.js +++ /dev/null @@ -1,71 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege. - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223733.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223733.js deleted file mode 100644 index 6bcb12f4..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223733.js +++ /dev/null @@ -1,76 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch() { - - } - - } ) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223747.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223747.js deleted file mode 100644 index 76ab1248..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223747.js +++ /dev/null @@ -1,77 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch(i.rate) { - case - - } - - } ) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223753.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223753.js deleted file mode 100644 index f4bd35ca..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223753.js +++ /dev/null @@ -1,78 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch(i.rate) { - case 128000: - - - } - - } ) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223816.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223816.js deleted file mode 100644 index 21a95a17..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223816.js +++ /dev/null @@ -1,94 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch(i.rate) { - case 999000: - size = item.sq ? sizeFormate(item.sq.size) : null - types.push({ type: 'flac', size }) - _types.flac = { - size, - } - case 320000: - size = item.h ? sizeFormate(item.h.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 192000: - case 128000: - size = item.l ? sizeFormate(item.l.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - } - - } ) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223823.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223823.js deleted file mode 100644 index 04e2bccb..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223823.js +++ /dev/null @@ -1,93 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 999000: - size = item.sq ? sizeFormate(item.sq.size) : null - types.push({ type: 'flac', size }) - _types.flac = { - size, - } - case 320000: - size = item.h ? sizeFormate(item.h.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 192000: - case 128000: - size = item.l ? sizeFormate(item.l.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223827.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609223827.js deleted file mode 100644 index 9abd6f9c..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609223827.js +++ /dev/null @@ -1,92 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 999000: - size = item.sq ? sizeFormate(item.sq.size) : null - types.push({ type: 'flac', size }) - _types.flac = { - size, - } - case 320000: - size = item.h ? sizeFormate(item.h.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 128000: - size = item.l ? sizeFormate(item.l.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224031.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224031.js deleted file mode 100644 index bc686d45..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224031.js +++ /dev/null @@ -1,98 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 999000: - size = item.sq ? sizeFormate(item.sq.size) : null - types.push({ type: 'flac', size }) - _types.flac = { - size, - } - case 320000: - size = item.h ? sizeFormate(item.h.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 128000: - size = item.l ? sizeFormate(item.l.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 1999000: - size = item.l ? sizeFormate(item.l.size) : null - types.push({ type: '128k', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224036.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224036.js deleted file mode 100644 index 556e095f..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224036.js +++ /dev/null @@ -1,98 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 999000: - size = item.sq ? sizeFormate(item.sq.size) : null - types.push({ type: 'flac', size }) - _types.flac = { - size, - } - case 320000: - size = item.h ? sizeFormate(item.h.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 128000: - size = item.l ? sizeFormate(item.l.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 1999000: - size = item.l ? sizeFormate(item.l.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224056.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224056.js deleted file mode 100644 index d5100053..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224056.js +++ /dev/null @@ -1,98 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 999000: - size = item.sq ? sizeFormate(item.sq.size) : null - types.push({ type: 'flac', size }) - _types.flac = { - size, - } - case 320000: - size = item.h ? sizeFormate(item.h.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 128000: - size = item.l ? sizeFormate(item.l.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224110.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224110.js deleted file mode 100644 index 29436010..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224110.js +++ /dev/null @@ -1,98 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 999000: - size = item.sq ? sizeFormate(item.sq.size) : null - types.push({ type: 'flac', size }) - _types.flac = { - size, - } - case 320000: - size = item.h ? sizeFormate(item.h.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 128000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224136.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224136.js deleted file mode 100644 index 3412259c..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224136.js +++ /dev/null @@ -1,98 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 999000: - size = item.sq ? sizeFormate(item.sq.size) : null - types.push({ type: 'flac', size }) - _types.flac = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 128000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224159.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224159.js deleted file mode 100644 index f7a72f42..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224159.js +++ /dev/null @@ -1,98 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 999000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: 'flac', size }) - _types.flac = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 128000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224216.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224216.js deleted file mode 100644 index 9e099825..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224216.js +++ /dev/null @@ -1,98 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 999000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 128000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224229.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224229.js deleted file mode 100644 index 95deb49c..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224229.js +++ /dev/null @@ -1,98 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.ori_audio_name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224359.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224359.js deleted file mode 100644 index e15307fb..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224359.js +++ /dev/null @@ -1,98 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.audio_info.audio_id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224416.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224416.js deleted file mode 100644 index 7c0a8f96..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224416.js +++ /dev/null @@ -1,98 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.id, - source: 'kg', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224418.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224418.js deleted file mode 100644 index 3feb4652..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224418.js +++ /dev/null @@ -1,98 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: decodeName(item.name), - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224432.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224432.js deleted file mode 100644 index 2b66e801..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224432.js +++ /dev/null @@ -1,98 +0,0 @@ -import { createEapiFetch } from './utils/index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: item.name, - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224457.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224457.js deleted file mode 100644 index 765e6b6b..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224457.js +++ /dev/null @@ -1,99 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime } from '../utils' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: item.name, - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224519.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224519.js deleted file mode 100644 index 69d6add4..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224519.js +++ /dev/null @@ -1,99 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime } from '../../music' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: item.name, - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224547.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224547.js deleted file mode 100644 index 044a0cfc..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224547.js +++ /dev/null @@ -1,99 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: item.name, - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(parseInt(item.audio_info.timelength) / 1000), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224621.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224621.js deleted file mode 100644 index 5a7cebde..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224621.js +++ /dev/null @@ -1,99 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: item.name, - albumName: decodeName(item.album_info.album_name), - albumId: item.album_info.album_id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224651.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224651.js deleted file mode 100644 index fd53b34a..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224651.js +++ /dev/null @@ -1,99 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: item.name, - albumName: item.album.name, - albumId: item.album_info.album_id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224705.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224705.js deleted file mode 100644 index 69993629..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224705.js +++ /dev/null @@ -1,99 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224959.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609224959.js deleted file mode 100644 index 9d195bb9..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609224959.js +++ /dev/null @@ -1,100 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: decodeName(item.author_name), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225008.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225008.js deleted file mode 100644 index 37a5d301..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225008.js +++ /dev/null @@ -1,100 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.author_name), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225015.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225015.js deleted file mode 100644 index 705684a5..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225015.js +++ /dev/null @@ -1,100 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - hash: item.audio_info.hash, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225029.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225029.js deleted file mode 100644 index 452049b1..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225029.js +++ /dev/null @@ -1,99 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225557.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225557.js deleted file mode 100644 index b45340a5..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225557.js +++ /dev/null @@ -1,99 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - return filterSongList(body) - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225623.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225623.js deleted file mode 100644 index 1d069461..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225623.js +++ /dev/null @@ -1,99 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - return filterSongList(body.filterSongList) - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225628.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225628.js deleted file mode 100644 index 8a7a1f9d..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225628.js +++ /dev/null @@ -1,99 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - async getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - async getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225739.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225739.js deleted file mode 100644 index 351ae2be..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225739.js +++ /dev/null @@ -1,102 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - getAlbumList() { - - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225749.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225749.js deleted file mode 100644 index 2796d227..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225749.js +++ /dev/null @@ -1,102 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - getAlbumList(id, page = 1, limit = 10) { - - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225803.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225803.js deleted file mode 100644 index 51f884df..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225803.js +++ /dev/null @@ -1,108 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225956.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609225956.js deleted file mode 100644 index 03d989f2..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609225956.js +++ /dev/null @@ -1,116 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230028.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230028.js deleted file mode 100644 index 9b2adfbb..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230028.js +++ /dev/null @@ -1,115 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230036.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230036.js deleted file mode 100644 index 1a540b12..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230036.js +++ /dev/null @@ -1,115 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230053.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230053.js deleted file mode 100644 index 6563b2da..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230053.js +++ /dev/null @@ -1,115 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterSongList(body.hotAlbums) - }) - } -} \ No newline at end of file diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230116.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230116.js deleted file mode 100644 index 9e9f1c75..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230116.js +++ /dev/null @@ -1,115 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterSongList(body.hotAlbums) - }) - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230133.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230133.js deleted file mode 100644 index 307e461a..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230133.js +++ /dev/null @@ -1,118 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterSongList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - - } - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230135.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230135.js deleted file mode 100644 index 2012c217..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230135.js +++ /dev/null @@ -1,118 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterSongList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230201.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230201.js deleted file mode 100644 index 04051a59..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230201.js +++ /dev/null @@ -1,122 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterSongList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230241.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230241.js deleted file mode 100644 index b756ed40..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230241.js +++ /dev/null @@ -1,122 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230313.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230313.js deleted file mode 100644 index 05b4e85d..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230313.js +++ /dev/null @@ -1,124 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230317.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230317.js deleted file mode 100644 index 49f29465..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230317.js +++ /dev/null @@ -1,122 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230344.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230344.js deleted file mode 100644 index 6a28a99b..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230344.js +++ /dev/null @@ -1,129 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - list.push({ - id: item.id, - info: { - - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230357.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230357.js deleted file mode 100644 index a34e2f8b..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230357.js +++ /dev/null @@ -1,130 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - list.push({ - id: item.id, - info: { - name: item.name - - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230431.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230431.js deleted file mode 100644 index 792aa382..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230431.js +++ /dev/null @@ -1,131 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - list.push({ - id: item.id, - count: item.size, - info: { - name: item.name - - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230456.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230456.js deleted file mode 100644 index e950a184..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230456.js +++ /dev/null @@ -1,132 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - list.push({ - id: item.id, - count: item.size, - info: { - name: item.name, - img: item.picUrl, - desc: "", - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230656.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230656.js deleted file mode 100644 index abac22fd..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230656.js +++ /dev/null @@ -1,132 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - list.push({ - id: item.id, - count: item.size, - info: { - name: item.name, - img: item.picUrl, - desc: null, - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230702.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230702.js deleted file mode 100644 index 8e375d9d..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230702.js +++ /dev/null @@ -1,131 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - list.push({ - id: item.id, - count: item.size, - info: { - name: item.name, - img: item.picUrl, - desc: null, - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230727.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230727.js deleted file mode 100644 index 1ec64465..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230727.js +++ /dev/null @@ -1,132 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - list.push({ - id: item.id, - count: item.size, - info: { - name: item.name, - author: formatSingerName(item), - img: item.picUrl, - desc: null, - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230734.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609230734.js deleted file mode 100644 index 0e9c28f0..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609230734.js +++ /dev/null @@ -1,132 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - list.push({ - id: item.id, - count: item.size, - info: { - name: item.name, - author: formatSingerName(item.artists), - img: item.picUrl, - desc: null, - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609232004.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609232004.js deleted file mode 100644 index 89fcd899..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609232004.js +++ /dev/null @@ -1,133 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - id: body.artist.id, - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - return filterSongList(body.songs) - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - list.push({ - id: item.id, - count: item.size, - info: { - name: item.name, - author: formatSingerName(item.artists), - img: item.picUrl, - desc: null, - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609232819.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609232819.js deleted file mode 100644 index b48cebf8..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609232819.js +++ /dev/null @@ -1,135 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - id: body.artist.id, - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - - const list = filterSongList(body.songs) - return - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - list.push({ - id: item.id, - count: item.size, - info: { - name: item.name, - author: formatSingerName(item.artists), - img: item.picUrl, - desc: null, - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609232854.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609232854.js deleted file mode 100644 index 796770a5..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609232854.js +++ /dev/null @@ -1,141 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - id: body.artist.id, - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - - const list = filterSongList(body.songs) - return { - list, - limit, - page, - // total: - source: 'wy', - } - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - list.push({ - id: item.id, - count: item.size, - info: { - name: item.name, - author: formatSingerName(item.artists), - img: item.picUrl, - desc: null, - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609232950.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609232950.js deleted file mode 100644 index 18c7d255..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609232950.js +++ /dev/null @@ -1,141 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - id: body.artist.id, - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - - const list = filterSongList(body.songs) - return { - list, - limit, - page, - total: body.total - source: 'wy', - } - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - list.push({ - id: item.id, - count: item.size, - info: { - name: item.name, - author: formatSingerName(item.artists), - img: item.picUrl, - desc: null, - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609232952.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609232952.js deleted file mode 100644 index 8cd23fbd..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609232952.js +++ /dev/null @@ -1,141 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - id: body.artist.id, - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - - const list = filterSongList(body.songs) - return { - list, - limit, - page, - total: body.total, - source: 'wy', - } - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - return filterAlbumList(body.hotAlbums) - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - list.push({ - id: item.id, - count: item.size, - info: { - name: item.name, - author: formatSingerName(item.artists), - img: item.picUrl, - desc: null, - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609234543.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609234543.js deleted file mode 100644 index 42cef820..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609234543.js +++ /dev/null @@ -1,143 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - id: body.artist.id, - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - - const list = filterSongList(body.songs) - return { - list, - limit, - page, - total: body.total, - source: 'wy', - } - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - - const list = this.filterAlbumList(body.hotAlbums) - return - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - list.push({ - id: item.id, - count: item.size, - info: { - name: item.name, - author: formatSingerName(item.artists), - img: item.picUrl, - desc: null, - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609234610.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609234610.js deleted file mode 100644 index 6a7251d8..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609234610.js +++ /dev/null @@ -1,148 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - id: body.artist.id, - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - - const list = this.filterSongList(body.songs) - return { - list, - limit, - page, - total: body.total, - source: 'wy', - } - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - - const list = this.filterAlbumList(body.hotAlbums) - return { - source: 'wy', - list, - limit, - page, - } - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - list.push({ - id: item.id, - count: item.size, - info: { - name: item.name, - author: formatSingerName(item.artists), - img: item.picUrl, - desc: null, - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/singer_20230609234742.js b/.history/src/renderer/utils/musicSdk/wy/singer_20230609234742.js deleted file mode 100644 index 000d3b88..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/singer_20230609234742.js +++ /dev/null @@ -1,149 +0,0 @@ -import { createEapiFetch } from './utils/index' -import { formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '../utils' - -export default { - /** - * 获取歌手信息 - * @param {*} id - */ - getInfo(id) { - return createEapiFetch('/api/artist/head/info/get', { id }).then(body => { - if (!body) throw new Error("get singer info faild.") - return { - source: 'wy', - id: body.artist.id, - info: { - name: body.artist.name, - desc: body.artist.briefDesc, - avatar: body.user.avatarUrl, - gender: body.user.gender === 1 ? '1' : '2', - }, - count: { - music: body.artist.musicSize, - album: body.artist.albumSize, - } - } - }) - }, - /** - * 获取歌手歌曲列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getSongList(id, page = 1, limit = 100) { - if (page === 1) page = 0 - return createEapiFetch('/api/v2/artist/songs', { - id, - limit, - offset: limit * page - }).then(body => { - if (!body.songs) throw new Error("get singer songs faild.") - - const list = this.filterSongList(body.songs) - return { - list, - limit, - page, - total: body.total, - source: 'wy', - } - }) - }, - /** - * 获取歌手专辑列表 - * @param {*} id - * @param {*} page - * @param {*} limit - */ - getAlbumList(id, page = 1, limit = 10) { - if (page === 1) page = 0 - return createEapiFetch(`/api/artist/albums/${id}`, { - limit, - offset: limit * page - }).then(body => { - if (!body.hotAlbums) throw new Error("get singer songs faild.") - - const list = this.filterAlbumList(body.hotAlbums) - return { - source: 'wy', - list, - limit, - page, - total: body.artist.albumSize - } - }) - }, - filterAlbumList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - list.push({ - id: item.id, - count: item.size, - info: { - name: item.name, - author: formatSingerName(item.artists), - img: item.picUrl, - desc: null, - }, - }) - }) - return list - }, - filterSongList(raw) { - const list = [] - raw.forEach(item => { - if (!item.id) return - - const types = [] - const _types = {} - item.privilege.chargeInfoList.forEach(i => { - switch (i.rate) { - case 128000: - size = item.lMusic ? sizeFormate(item.lMusic.size) : null - types.push({ type: '128k', size }) - _types['128k'] = { - size, - } - case 320000: - size = item.hMusic ? sizeFormate(item.hMusic.size) : null - types.push({ type: '320k', size }) - _types['320k'] = { - size, - } - case 999000: - size = item.sqMusic ? sizeFormate(item.sqMusic.size) : null - types.push({ type: 'flac', size }) - _typesflac = { - size, - } - case 1999000: - size = item.hrMusic ? sizeFormate(item.hrMusic.size) : null - types.push({ type: 'flac24bit', size }) - _types.flac24bit = { - size, - } - } - }) - - list.push({ - singer: formatSingerName(item.artists), - name: item.name, - albumName: item.album.name, - albumId: item.album.id, - songmid: item.id, - source: 'wy', - interval: formatPlayTime(item.duration), - img: null, - lrc: null, - otherSource: null, - types, - _types, - typeUrl: {}, - }) - }) - return list - }, -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230521134626.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230521134626.js deleted file mode 100644 index ce27143e..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230521134626.js +++ /dev/null @@ -1,22 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213722.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213722.js deleted file mode 100644 index d194a8d9..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213722.js +++ /dev/null @@ -1,49 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于KG的Http请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createHttpFetch = async(url, options, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - let result - try { - result = await httpFetch(url, options).promise - } catch (err) { - console.log(err) - return createHttpFetch(url, options, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || - ( - result.body.error_code ?? - result.body.errcode ?? - result.body.err_code) != 0 - ) return createHttpFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213741.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213741.js deleted file mode 100644 index d3414645..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213741.js +++ /dev/null @@ -1,48 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于KG的Http请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createHttpFetch = async(url, options, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - let result - try { - result = await httpFetch(url, options).promise - } catch (err) { - console.log(err) - return createHttpFetch(url, options, ++retryNum) - } - if (result.statusCode !== 200 || - ( - result.body.error_code ?? - result.body.errcode ?? - result.body.err_code) != 0 - ) return createHttpFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213807.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213807.js deleted file mode 100644 index dee31083..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213807.js +++ /dev/null @@ -1,43 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于KG的Http请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createHttpFetch = async(url, options, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - let result - try { - result = await httpFetch(url, options).promise - } catch (err) { - console.log(err) - return createHttpFetch(url, options, ++retryNum) - } - if (result.statusCode !== 200 || result.body.code != 200) return createHttpFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213814.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213814.js deleted file mode 100644 index 4077b07d..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213814.js +++ /dev/null @@ -1,43 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Http请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createHttpFetch = async(url, options, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - let result - try { - result = await httpFetch(url, options).promise - } catch (err) { - console.log(err) - return createHttpFetch(url, options, ++retryNum) - } - if (result.statusCode !== 200 || result.body.code != 200) return createHttpFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213832.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213832.js deleted file mode 100644 index f1b5140b..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609213832.js +++ /dev/null @@ -1,42 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Http请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createHttpFetch = async(url, options, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - let result - try { - result = await httpFetch(url, options).promise - } catch (err) { - console.log(err) - return createHttpFetch(url, options, ++retryNum) - } - if (result.statusCode !== 200 || result.body.code != 200) return createHttpFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - return result.body -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609214124.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609214124.js deleted file mode 100644 index ce27143e..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609214124.js +++ /dev/null @@ -1,22 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215059.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215059.js deleted file mode 100644 index aee2a75d..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215059.js +++ /dev/null @@ -1,49 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, options, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - let result - try { - result = await httpFetch(url, options).promise - } catch (err) { - console.log(err) - return createHttpFetch(url, options, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || - ( - result.body.error_code ?? - result.body.errcode ?? - result.body.err_code) != 0 - ) return createHttpFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215140.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215140.js deleted file mode 100644 index a1b9eca8..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215140.js +++ /dev/null @@ -1,49 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - let result - try { - result = await httpFetch(url, options).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || - ( - result.body.error_code ?? - result.body.errcode ?? - result.body.err_code) != 0 - ) return createEapiFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215240.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215240.js deleted file mode 100644 index d43c57b6..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215240.js +++ /dev/null @@ -1,50 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - let result - try { - result = await httpFetch(url, options).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || - ( - result.body.error_code ?? - result.body.errcode ?? - result.body.err_code) != 0 - ) return createEapiFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215413.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215413.js deleted file mode 100644 index 63fe85ba..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215413.js +++ /dev/null @@ -1,63 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: data, - }) -} - - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - let result - try { - result = await httpFetch(url, options).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || - ( - result.body.error_code ?? - result.body.errcode ?? - result.body.err_code) != 0 - ) return createEapiFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215428.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215428.js deleted file mode 100644 index d2d26b34..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215428.js +++ /dev/null @@ -1,63 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: data, - }) -} - - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - let result - try { - result = await httpFetch(url, options).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || - ( - result.body.error_code ?? - result.body.errcode ?? - result.body.err_code) != 0 - ) return createEapiFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215435.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215435.js deleted file mode 100644 index a8dabe93..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215435.js +++ /dev/null @@ -1,62 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: data, - }) -} - - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - let result - try { - result = await httpFetch(url, options).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || - ( - result.body.error_code ?? - result.body.errcode ?? - result.body.err_code) != 0 - ) return createEapiFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215438.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215438.js deleted file mode 100644 index 98623eb1..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215438.js +++ /dev/null @@ -1,61 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: data, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - let result - try { - result = await httpFetch(url, options).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || - ( - result.body.error_code ?? - result.body.errcode ?? - result.body.err_code) != 0 - ) return createEapiFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215445.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215445.js deleted file mode 100644 index 23f7ff93..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215445.js +++ /dev/null @@ -1,61 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: data, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - let result - try { - result = await buildEapiRequest(url, options).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || - ( - result.body.error_code ?? - result.body.errcode ?? - result.body.err_code) != 0 - ) return createEapiFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215451.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215451.js deleted file mode 100644 index df62bab4..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215451.js +++ /dev/null @@ -1,61 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: data, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - let result - try { - result = await buildEapiRequest(data).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || - ( - result.body.error_code ?? - result.body.errcode ?? - result.body.err_code) != 0 - ) return createEapiFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215506.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215506.js deleted file mode 100644 index 6f116202..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215506.js +++ /dev/null @@ -1,61 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: data, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - let result - try { - result = await buildEapiRequest(fromData).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || - ( - result.body.error_code ?? - result.body.errcode ?? - result.body.err_code) != 0 - ) return createEapiFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215510.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215510.js deleted file mode 100644 index 0a79acea..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215510.js +++ /dev/null @@ -1,62 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: data, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - - let result - try { - result = await buildEapiRequest(fromData).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || - ( - result.body.error_code ?? - result.body.errcode ?? - result.body.err_code) != 0 - ) return createEapiFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215513.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215513.js deleted file mode 100644 index 385bfaff..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215513.js +++ /dev/null @@ -1,62 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: data, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - - let result - try { - result = await buildEapiRequest(fromData).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || - ( - result.body.error_code ?? - result.body.errcode ?? - result.body.err_code) != 0 - ) return createEapiFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215535.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215535.js deleted file mode 100644 index 21a5efe3..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215535.js +++ /dev/null @@ -1,57 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: data, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - - let result - try { - result = await buildEapiRequest(fromData).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, options, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215546.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215546.js deleted file mode 100644 index 20cb3533..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215546.js +++ /dev/null @@ -1,57 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: data, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - - let result - try { - result = await buildEapiRequest(fromData).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) - if (result.body.data) return result.body.data - if (Array.isArray(result.body.info)) return result.body - return result.body.info -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215557.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215557.js deleted file mode 100644 index 195cb895..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215557.js +++ /dev/null @@ -1,56 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: data, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - - let result - try { - result = await buildEapiRequest(fromData).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - // console.log(result.statusCode, result.body) - if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) - if (result.body.data) return result.body.data - return result.body -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215601.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215601.js deleted file mode 100644 index f9b6c522..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215601.js +++ /dev/null @@ -1,56 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: data, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - - let result - try { - result = await buildEapiRequest(fromData).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - - if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) - if (result.body.data) return result.body.data - return result.body -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215616.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215616.js deleted file mode 100644 index 4e7499f7..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215616.js +++ /dev/null @@ -1,56 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (from) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: data, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - - let result - try { - result = await buildEapiRequest(fromData).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - - if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) - if (result.body.data) return result.body.data - return result.body -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215628.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215628.js deleted file mode 100644 index e1aed9a7..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215628.js +++ /dev/null @@ -1,56 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (formData) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: formData, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const fromData = eapi(url, data) - - let result - try { - result = await buildEapiRequest(fromData).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - - if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) - if (result.body.data) return result.body.data - return result.body -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215641.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215641.js deleted file mode 100644 index d7eb763e..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609215641.js +++ /dev/null @@ -1,56 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (formData) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: formData, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const formData = eapi(url, data) - - let result - try { - result = await buildEapiRequest(formData).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - - if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) - if (result.body.data) return result.body.data - return result.body -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224836.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224836.js deleted file mode 100644 index 8f5c8af8..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224836.js +++ /dev/null @@ -1,64 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (formData) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: formData, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const formData = eapi(url, data) - - let result - try { - result = await buildEapiRequest(formData).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - - if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) - if (result.body.data) return result.body.data - return result.body -} - -getSinger(singers) { - let arr = [] - singers?.forEach(singer => { - arr.push(singer.name) - }) - return arr.join('、') -}, diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224839.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224839.js deleted file mode 100644 index 38602304..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224839.js +++ /dev/null @@ -1,64 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (formData) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: formData, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const formData = eapi(url, data) - - let result - try { - result = await buildEapiRequest(formData).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - - if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) - if (result.body.data) return result.body.data - return result.body -} - -getSinger(singers) { - let arr = [] - singers?.forEach(singer => { - arr.push(singer.name) - }) - return arr.join('、') -} diff --git a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224855.js b/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224855.js deleted file mode 100644 index d7eb763e..00000000 --- a/.history/src/renderer/utils/musicSdk/wy/utils/index_20230609224855.js +++ /dev/null @@ -1,56 +0,0 @@ -import { httpFetch } from '../../../request' -import { eapi } from './crypto' - -const buildEapiRequest = (formData) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - }, - form: formData, - }) -} - -export const eapiRequest = (url, data) => { - return httpFetch('http://interface.music.163.com/eapi/batch', { - method: 'post', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', - origin: 'https://music.163.com', - // cookie: 'os=pc; deviceId=A9C064BB4584D038B1565B58CB05F95290998EE8B025AA2D07AE; osver=Microsoft-Windows-10-Home-China-build-19043-64bit; appver=2.5.2.197409; channel=netease; MUSIC_A=37a11f2eb9de9930cad479b2ad495b0e4c982367fb6f909d9a3f18f876c6b49faddb3081250c4980dd7e19d4bd9bf384e004602712cf2b2b8efaafaab164268a00b47359f85f22705cc95cb6180f3aee40f5be1ebf3148d888aa2d90636647d0c3061cd18d77b7a0; __csrf=05b50d54082694f945d7de75c210ef94; mode=Z7M-KP5(7)GZ; NMTID=00OZLp2VVgq9QdwokUgq3XNfOddQyIAAAF_6i8eJg; ntes_kaola_ad=1', - }, - form: eapi(url, data), - }) - // requestObj.promise = requestObj.promise.then(({ body }) => { - // // console.log(raw) - // console.log(body) - // // console.log(eapiDecrypt(raw)) - // // return eapiDecrypt(raw) - // return body - // }) - // return requestObj -} - -/** - * 创建一个适用于WY的Eapi请求 - * @param {*} url - * @param {*} options - * @param {*} retryNum - */ -export const createEapiFetch = async(url, data, retryNum = 0) => { - if (retryNum > 2) throw new Error('try max num') - const formData = eapi(url, data) - - let result - try { - result = await buildEapiRequest(formData).promise - } catch (err) { - console.log(err) - return createEapiFetch(url, data, ++retryNum) - } - - if (result.statusCode !== 200 || result.body.code != 200) return createEapiFetch(url, data, ++retryNum) - if (result.body.data) return result.body.data - return result.body -}