commit
41f4130e5d
|
@ -3,6 +3,7 @@ module.exports = {
|
|||
reject: [
|
||||
'electron',
|
||||
'chalk',
|
||||
'del',
|
||||
],
|
||||
// target: 'newest',
|
||||
// filter: [
|
||||
|
|
16
CHANGELOG.md
16
CHANGELOG.md
|
@ -6,6 +6,22 @@ Project versioning adheres to [Semantic Versioning](http://semver.org/).
|
|||
Commit convention is based on [Conventional Commits](http://conventionalcommits.org).
|
||||
Change log format is based on [Keep a Changelog](http://keepachangelog.com/).
|
||||
|
||||
## [1.22.2](https://github.com/lyswhut/lx-music-desktop/compare/v1.22.1...v1.22.2) - 2022-08-18
|
||||
|
||||
### 优化
|
||||
|
||||
- 为tx、kw源添加 Flac 24bit 音质显示,注:由于之前没有记录此音质,所以之前收藏的歌曲信息中不包含它
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复无法批量排序歌曲的问题
|
||||
- 修复某些缺失的繁体中文翻译
|
||||
- 修复企鹅音乐搜索失效的问题
|
||||
|
||||
### 其他
|
||||
|
||||
- 降级electron到v15.5.7
|
||||
|
||||
## [1.22.1](https://github.com/lyswhut/lx-music-desktop/compare/v1.22.0...v1.22.1) - 2022-07-09
|
||||
|
||||
### 优化
|
||||
|
|
|
@ -2,12 +2,16 @@
|
|||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@/*": ["src/*"],
|
||||
"@main/*": ["src/main/*"],
|
||||
"@renderer/*": ["src/renderer/*"],
|
||||
"@lyric/*": ["src/renderer-lyric/*"],
|
||||
"@static/*": ["src/static/*"],
|
||||
"@common/*": ["src/common/*"],
|
||||
}
|
||||
},
|
||||
},
|
||||
"vueCompilerOptions": {
|
||||
"experimentalDisableTemplateSupport": true
|
||||
},
|
||||
"exclude": ["node_modules", "build", "dist"]
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
49
package.json
49
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "lx-music-desktop",
|
||||
"version": "1.22.1",
|
||||
"version": "1.22.2",
|
||||
"description": "一个免费的音乐查找助手",
|
||||
"main": "./dist/main.js",
|
||||
"productName": "lx-music-desktop",
|
||||
|
@ -70,7 +70,7 @@
|
|||
"up": "cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=http://localhost:1081 npm i"
|
||||
},
|
||||
"browserslist": [
|
||||
"Electron 17.4.7"
|
||||
"Electron 15.5.7"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 16",
|
||||
|
@ -178,34 +178,34 @@
|
|||
},
|
||||
"homepage": "https://github.com/lyswhut/lx-music-desktop#readme",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.18.6",
|
||||
"@babel/eslint-parser": "^7.18.2",
|
||||
"@babel/core": "^7.18.10",
|
||||
"@babel/eslint-parser": "^7.18.9",
|
||||
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||
"@babel/plugin-transform-modules-umd": "^7.18.6",
|
||||
"@babel/plugin-transform-runtime": "^7.18.6",
|
||||
"@babel/preset-env": "^7.18.6",
|
||||
"@babel/plugin-transform-runtime": "^7.18.10",
|
||||
"@babel/preset-env": "^7.18.10",
|
||||
"babel-loader": "^8.2.5",
|
||||
"babel-preset-minify": "^0.5.2",
|
||||
"browserslist": "^4.21.1",
|
||||
"browserslist": "^4.21.3",
|
||||
"chalk": "^4.1.2",
|
||||
"changelog-parser": "^2.8.1",
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
"core-js": "^3.23.3",
|
||||
"core-js": "^3.24.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^6.7.1",
|
||||
"css-minimizer-webpack-plugin": "^4.0.0",
|
||||
"del": "^6.1.1",
|
||||
"electron": "^17.4.10",
|
||||
"electron-builder": "^23.3.0",
|
||||
"electron": "^15.5.7",
|
||||
"electron-builder": "^23.3.3",
|
||||
"electron-debug": "^3.2.0",
|
||||
"electron-devtools-installer": "^3.2.0",
|
||||
"electron-to-chromium": "^1.4.184",
|
||||
"electron-updater": "^5.1.0",
|
||||
"eslint": "^8.19.0",
|
||||
"electron-to-chromium": "^1.4.224",
|
||||
"electron-updater": "^5.2.1",
|
||||
"eslint": "^8.22.0",
|
||||
"eslint-config-standard": "^17.0.0",
|
||||
"eslint-formatter-friendly": "git+https://github.com/lyswhut/eslint-friendly-formatter.git#2170d1320e2fad13615a9dcf229669f0bb473a53",
|
||||
"eslint-plugin-html": "^6.2.0",
|
||||
"eslint-plugin-html": "^7.1.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^6.0.0",
|
||||
|
@ -216,8 +216,8 @@
|
|||
"less-loader": "^11.0.0",
|
||||
"mini-css-extract-plugin": "^2.6.1",
|
||||
"node-loader": "^2.0.0",
|
||||
"postcss": "^8.4.14",
|
||||
"postcss-loader": "^7.0.0",
|
||||
"postcss": "^8.4.16",
|
||||
"postcss-loader": "^7.0.1",
|
||||
"postcss-pxtorem": "^6.0.0",
|
||||
"pug": "^3.0.2",
|
||||
"pug-loader": "^2.4.0",
|
||||
|
@ -228,13 +228,14 @@
|
|||
"svg-sprite-loader": "^6.0.11",
|
||||
"svg-transform-loader": "^2.0.13",
|
||||
"svgo-loader": "^3.0.1",
|
||||
"terser-webpack-plugin": "^5.3.3",
|
||||
"terser": "^5.14.2",
|
||||
"terser-webpack-plugin": "^5.3.5",
|
||||
"url-loader": "^4.1.1",
|
||||
"vue-loader": "^17.0.0",
|
||||
"vue-template-compiler": "^2.7.4",
|
||||
"webpack": "^5.73.0",
|
||||
"vue-template-compiler": "^2.7.8",
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"webpack-dev-server": "^4.9.3",
|
||||
"webpack-dev-server": "^4.10.0",
|
||||
"webpack-hot-middleware": "git+https://github.com/lyswhut/webpack-hot-middleware.git#329c4375134b89d39da23a56a94db651247c74a1",
|
||||
"webpack-merge": "^5.8.0"
|
||||
},
|
||||
|
@ -242,11 +243,11 @@
|
|||
"bufferutil": "^4.0.6",
|
||||
"crypto-js": "^4.1.1",
|
||||
"electron-log": "^4.4.8",
|
||||
"electron-store": "^8.0.2",
|
||||
"electron-store": "^8.1.0",
|
||||
"font-list": "git+https://github.com/lyswhut/node-font-list.git#4edbb1933b49a9bac1eedd63a31da16b487fe57d",
|
||||
"http-terminator": "^3.2.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"image-size": "^1.0.1",
|
||||
"image-size": "^1.0.2",
|
||||
"koa": "^2.13.4",
|
||||
"long": "^5.2.0",
|
||||
"mitt": "^3.0.0",
|
||||
|
@ -258,8 +259,8 @@
|
|||
"tunnel": "^0.0.6",
|
||||
"utf-8-validate": "^5.0.9",
|
||||
"vue": "^3.2.37",
|
||||
"vue-i18n": "^9.2.0-beta.36",
|
||||
"vue-router": "^4.1.1",
|
||||
"vue-i18n": "^9.2.2",
|
||||
"vue-router": "^4.1.3",
|
||||
"vuex": "^4.0.2"
|
||||
},
|
||||
"overrides": {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
### 优化
|
||||
|
||||
- 歌单列表添加歌单内歌曲数量显示,注:目前只有kw、mg、wy、tx(部分)源支持显示
|
||||
- 为tx、kw源添加 Flac 24bit 音质显示,注:由于之前没有记录此音质,所以之前收藏的歌曲信息中不包含它
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复处于不支持的源时,歌单、排行榜的右键下载菜单没有禁用的问题
|
||||
- 修复若桌面歌词窗口与主窗口重叠时,鼠标划过重叠区域鼠标会闪烁的问题,注:此修复只对未启用“鼠标移入歌词区域时降低歌词透明度”时有效
|
||||
- 修复tx源搜索失效的问题
|
||||
- 修复无法批量排序歌曲的问题
|
||||
- 修复某些缺失的繁体中文翻译
|
||||
- 修复企鹅音乐搜索失效的问题
|
||||
|
||||
### 其他
|
||||
|
||||
- 升级Electron到 v17.4.10
|
||||
- 降级electron到v15.5.7
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -34,8 +34,8 @@ const defaultSetting = {
|
|||
isLock: false,
|
||||
isAlwaysOnTop: false,
|
||||
isAlwaysOnTopLoop: false,
|
||||
width: 380,
|
||||
height: 420,
|
||||
width: 450,
|
||||
height: 300,
|
||||
x: null,
|
||||
y: null,
|
||||
theme: 0,
|
||||
|
|
|
@ -32,6 +32,7 @@ langs.forEach(item => {
|
|||
langList.push({
|
||||
name: item.name,
|
||||
locale: item.locale,
|
||||
alternate: item.alternate,
|
||||
})
|
||||
messages[item.locale] = item.message
|
||||
})
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
"desktop_lyric__unlock": "解鎖歌詞",
|
||||
"desktop_lyric__win_top_off": "取消置頂歌詞界面",
|
||||
"desktop_lyric__win_top_on": "置頂歌詞界面",
|
||||
"download": "下載管理",
|
||||
"download": "下載",
|
||||
"download__all": "全部任務",
|
||||
"download__error": "出錯",
|
||||
"download__finished": "下載完成",
|
||||
|
@ -91,7 +91,7 @@
|
|||
"list_add__btn_title": "把該歌曲添加到 {name}",
|
||||
"list_add__multiple_btn_title": "把這些歌曲添加到 {name}",
|
||||
"list_add__multiple_title_add": "添加已選的 {num} 首歌曲到...",
|
||||
"list_add__multiple_title_move": "添加移動已選的 {num} 首歌曲到...",
|
||||
"list_add__multiple_title_move": "移動已選的 {num} 首歌曲到...",
|
||||
"list_add__title_first_add": "添加",
|
||||
"list_add__title_first_move": "移動",
|
||||
"list_add__title_last": "到...",
|
||||
|
@ -134,9 +134,9 @@
|
|||
"lists__sync": "更新",
|
||||
"lists__sync_confirm_tip": "這將會把 {name} 內的歌曲替換成在線列表的歌曲,你確認要更新嗎?",
|
||||
"load_list_file_error_detail": "我們已經幫你把舊的列表文件備份到{path}\n它以 JSON 格式存儲,你可以嘗試手動修復並恢復它\n\n錯誤詳情:{detail}",
|
||||
"load_list_file_error_title": "播放列表數據加載錯誤",
|
||||
"load_list_file_error_title": "播放列表數據加載錯誤(建議到GitHub或加群反饋)",
|
||||
"loding": "加載中...",
|
||||
"love_list": "收藏列表",
|
||||
"love_list": "收藏",
|
||||
"lyric__load_error": "歌詞獲取失敗",
|
||||
"lyric__select": "歌詞文本選擇",
|
||||
"lyric_menu__align": "歌詞對齊方式",
|
||||
|
@ -144,11 +144,11 @@
|
|||
"lyric_menu__align_left": "居左",
|
||||
"lyric_menu__lrc_size": "字體大小 [ {size} ]",
|
||||
"lyric_menu__offset": "歌詞偏移 [ {offset}ms ]",
|
||||
"lyric_menu__offset_add_10": "加快10毫秒(右擊加快5毫秒)",
|
||||
"lyric_menu__offset_add_10": "加快10毫秒",
|
||||
"lyric_menu__offset_add_100": "加快100毫秒",
|
||||
"lyric_menu__offset_dec_10": "減慢10毫秒",
|
||||
"lyric_menu__offset_dec_100": "減慢100毫秒",
|
||||
"lyric_menu__offset_reset": "重置偏移",
|
||||
"lyric_menu__offset_reset": "重置",
|
||||
"lyric_menu__size_add": "加大字體(右擊可微調)",
|
||||
"lyric_menu__size_dec": "減小字體(右擊可微調)",
|
||||
"lyric_menu__size_reset": "重置",
|
||||
|
@ -179,7 +179,6 @@
|
|||
"play_timeout_unit": "分鐘",
|
||||
"play_timeout_update": "更新定時",
|
||||
"player__add_music_to": "添加當前歌曲到...",
|
||||
"player__album": "專輯名:",
|
||||
"player__buffering": "緩衝中...",
|
||||
"player__desktop_lyric_lock": "右擊鎖定歌詞",
|
||||
"player__desktop_lyric_off": "關閉桌面歌詞",
|
||||
|
@ -190,6 +189,7 @@
|
|||
"player__geting_url": "歌曲鏈接獲取中...",
|
||||
"player__hide_detail_tip": "隱藏詳情頁(界面內右鍵雙擊可快速隱藏詳情頁)",
|
||||
"player__loading": "音樂加載中...",
|
||||
"player__music_album": "專輯名:",
|
||||
"player__music_name": "歌曲名:",
|
||||
"player__music_singer": "藝術家:",
|
||||
"player__next": "下一首",
|
||||
|
@ -313,7 +313,7 @@
|
|||
"setting__hot_key_local_title": "軟件內快捷鍵",
|
||||
"setting__hot_key_player_next": "下一首歌曲",
|
||||
"setting__hot_key_player_prev": "上一首歌曲",
|
||||
"setting__hot_key_player_toggle_play": "播放/暫停控制",
|
||||
"setting__hot_key_player_toggle_play": "播放/暫停控制",
|
||||
"setting__hot_key_player_volume_down": "減少音量",
|
||||
"setting__hot_key_player_volume_mute": "靜音切換",
|
||||
"setting__hot_key_player_volume_up": "增加音量",
|
||||
|
|
|
@ -23,6 +23,7 @@ const handleSaveList = ({ defaultList, loveList, userList, tempList }) => {
|
|||
getStore('playList').set(data)
|
||||
}
|
||||
mainOn(ipcMainWindowNames.save_playlist, (event, { type, data }) => {
|
||||
data = JSON.parse(data)
|
||||
switch (type) {
|
||||
case 'myList':
|
||||
handleSaveList(data)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<main :class="$style.main">
|
||||
<h2>{{ info.name }}<br/>{{ info.singer }}</h2>
|
||||
<base-btn :class="$style.btn" :key="type.type" @click="handleClick(type.type)" v-for="type in types"
|
||||
>{{getTypeName(type.type)}} {{ type.type.toUpperCase() }}{{ type.size && ` - ${type.size.toUpperCase()}` }}</base-btn>
|
||||
>{{getTypeName(type.type)}}{{ type.size && ` - ${type.size.toUpperCase()}` }}</base-btn>
|
||||
</main>
|
||||
</material-modal>
|
||||
</template>
|
||||
|
@ -56,15 +56,16 @@ export default {
|
|||
getTypeName(type) {
|
||||
switch (type) {
|
||||
case 'flac32bit':
|
||||
return this.$t('download__lossless') + ' FLAC Hires'
|
||||
case 'flac':
|
||||
case 'ape':
|
||||
case 'wav':
|
||||
return this.$t('download__lossless')
|
||||
return this.$t('download__lossless') + ' ' + type.toUpperCase()
|
||||
case '320k':
|
||||
return this.$t('download__high_quality')
|
||||
return this.$t('download__high_quality') + ' ' + type.toUpperCase()
|
||||
case '192k':
|
||||
case '128k':
|
||||
return this.$t('download__normal')
|
||||
return this.$t('download__normal') + ' ' + type.toUpperCase()
|
||||
}
|
||||
},
|
||||
checkSource(type) {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<base-btn :class="$style.btn" @click="handleClick('128k')">{{$t('download__normal')}} - 128K</base-btn>
|
||||
<base-btn :class="$style.btn" @click="handleClick('320k')">{{$t('download__high_quality')}} - 320K</base-btn>
|
||||
<base-btn :class="$style.btn" @click="handleClick('flac')">{{$t('download__lossless')}} - FLAC</base-btn>
|
||||
<base-btn :class="$style.btn" @click="handleClick('flac32bit')">{{$t('download__lossless')}} - FLAC 24bit</base-btn>
|
||||
<base-btn :class="$style.btn" @click="handleClick('flac32bit')">{{$t('download__lossless')}} - FLAC Hires</base-btn>
|
||||
</main>
|
||||
</material-modal>
|
||||
</template>
|
||||
|
|
|
@ -189,7 +189,7 @@ const mutations = {
|
|||
break
|
||||
}
|
||||
}
|
||||
window.eventHub.emit(eventListNames.listChange, [fromId, toList])
|
||||
window.eventHub.emit(eventListNames.listChange, [fromId, toId])
|
||||
},
|
||||
listAddMultiple(state, { id, list, addMusicLocationType, isSync }) {
|
||||
if (!addMusicLocationType) addMusicLocationType = this.state.setting.list.addMusicLocationType
|
||||
|
|
|
@ -79,6 +79,7 @@ export const b64DecodeUnicode = str => {
|
|||
}
|
||||
|
||||
const encodeNames = {
|
||||
' ': ' ',
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
|
@ -86,7 +87,7 @@ const encodeNames = {
|
|||
''': "'",
|
||||
''': "'",
|
||||
}
|
||||
export const decodeName = (str = '') => str?.replace(/(?:&|<|>|"|'|')/gm, s => encodeNames[s]) || ''
|
||||
export const decodeName = (str = '') => str?.replace(/(?:&|<|>|"|'|'| )/gm, s => encodeNames[s]) || ''
|
||||
|
||||
const easeInOutQuad = (t, b, c, d) => {
|
||||
t /= d / 2
|
||||
|
|
|
@ -43,6 +43,12 @@ export default {
|
|||
size: null,
|
||||
}
|
||||
}
|
||||
if (formats.includes('HIRFLAC')) {
|
||||
types.push({ type: 'flac32bit', size: null })
|
||||
_types.flac32bit = {
|
||||
size: null,
|
||||
}
|
||||
}
|
||||
// types.reverse()
|
||||
return {
|
||||
singer: formatSinger(decodeName(item.artist)),
|
||||
|
@ -78,6 +84,7 @@ export default {
|
|||
body = objStr2JSON(body)
|
||||
// console.log(body)
|
||||
if (!body.musiclist) return this.getAlbumListDetail(id, page, ++retryNum)
|
||||
body.name = decodeName(body.name)
|
||||
return {
|
||||
list: this.filterListDetail(body.musiclist, body.name, body.albumid),
|
||||
page,
|
||||
|
@ -87,11 +94,38 @@ export default {
|
|||
info: {
|
||||
name: body.name,
|
||||
img: body.img || body.hts_img,
|
||||
desc: body.info,
|
||||
author: body.artist,
|
||||
desc: decodeName(body.info),
|
||||
author: decodeName(body.artist),
|
||||
// play_count: this.formatPlayCount(body.playnum),
|
||||
},
|
||||
}
|
||||
})
|
||||
},
|
||||
// getAlbumListDetail(id, page, retryNum = 0) {
|
||||
// if (retryNum > 2) return Promise.reject(new Error('try max num'))
|
||||
// return tokenRequest(`http://www.kuwo.cn/api/www/album/albumInfo?albumId=${id}&pn=${page}&rn=${this.limit_song}&httpsStatus=1`).then((resp) => {
|
||||
// return resp.promise.then(({ statusCode, body }) => {
|
||||
// console.log(body)
|
||||
// return Promise.reject(new Error('failed'))
|
||||
// // if (statusCode !== 200) return this.getAlbumListDetail(id, page, ++retryNum)
|
||||
// // const data = body.data
|
||||
// // console.log(data)
|
||||
// // if (!data.musicList) return this.getAlbumListDetail(id, page, ++retryNum)
|
||||
// // return {
|
||||
// // list: this.filterListDetail(data.musiclist),
|
||||
// // page,
|
||||
// // limit: this.limit_song,
|
||||
// // total: data.total,
|
||||
// // source: 'kw',
|
||||
// // info: {
|
||||
// // name: data.album,
|
||||
// // img: data.pic,
|
||||
// // desc: data.albuminfo,
|
||||
// // author: data.artist,
|
||||
// // play_count: this.formatPlayCount(data.playCnt),
|
||||
// // },
|
||||
// // }
|
||||
// })
|
||||
// })
|
||||
// },
|
||||
}
|
||||
|
|
|
@ -115,6 +115,12 @@ export default {
|
|||
size: null,
|
||||
}
|
||||
}
|
||||
if (formats.includes('HIRFLAC')) {
|
||||
types.push({ type: 'flac32bit', size: null })
|
||||
_types.flac32bit = {
|
||||
size: null,
|
||||
}
|
||||
}
|
||||
// types.reverse()
|
||||
return {
|
||||
singer: formatSinger(decodeName(item.artist)),
|
||||
|
|
|
@ -7,7 +7,7 @@ import { formatSinger } from './util'
|
|||
|
||||
export default {
|
||||
regExps: {
|
||||
mInfo: /bitrate:(\d+),format:(\w+),size:([\w.]+)/,
|
||||
mInfo: /level:(\w+),bitrate:(\d+),format:(\w+),size:([\w.]+)/,
|
||||
},
|
||||
limit: 30,
|
||||
total: 0,
|
||||
|
@ -27,61 +27,53 @@ export default {
|
|||
handleResult(rawData) {
|
||||
const result = []
|
||||
if (!rawData) return result
|
||||
// console.log(rawData)
|
||||
for (let i = 0; i < rawData.length; i++) {
|
||||
const info = rawData[i]
|
||||
let songId = info.MUSICRID.replace('MUSIC_', '')
|
||||
// const format = (info.FORMATS || info.formats).split('|')
|
||||
|
||||
if (!info.MINFO) {
|
||||
console.log('mInfo is undefined')
|
||||
if (!info.N_MINFO) {
|
||||
console.log('N_MINFO is undefined')
|
||||
return null
|
||||
}
|
||||
|
||||
const types = []
|
||||
const _types = {}
|
||||
|
||||
let infoArr = info.MINFO.split(';')
|
||||
infoArr.forEach(info => {
|
||||
let infoArr = info.N_MINFO.split(';')
|
||||
for (let info of infoArr) {
|
||||
info = info.match(this.regExps.mInfo)
|
||||
if (info) {
|
||||
switch (info[2]) {
|
||||
case 'flac':
|
||||
types.push({ type: 'flac', size: info[3] })
|
||||
_types.flac = {
|
||||
size: info[3].toLocaleUpperCase(),
|
||||
case '4000':
|
||||
types.push({ type: 'flac32bit', size: info[4] })
|
||||
_types.flac32bit = {
|
||||
size: info[4].toLocaleUpperCase(),
|
||||
}
|
||||
break
|
||||
// case 'ape':
|
||||
// types.push({ type: 'ape', size: info[3] })
|
||||
// _types.ape = {
|
||||
// size: info[3].toLocaleUpperCase(),
|
||||
// }
|
||||
// break
|
||||
case 'mp3':
|
||||
switch (info[1]) {
|
||||
case '320':
|
||||
types.push({ type: '320k', size: info[3] })
|
||||
_types['320k'] = {
|
||||
size: info[3].toLocaleUpperCase(),
|
||||
}
|
||||
break
|
||||
case '192':
|
||||
// types.push({ type: '192k', size: info[3] })
|
||||
// _types['192k'] = {
|
||||
// size: info[3].toLocaleUpperCase(),
|
||||
// }
|
||||
// break
|
||||
case '128':
|
||||
types.push({ type: '128k', size: info[3] })
|
||||
_types['128k'] = {
|
||||
size: info[3].toLocaleUpperCase(),
|
||||
}
|
||||
break
|
||||
case '2000':
|
||||
types.push({ type: 'flac', size: info[4] })
|
||||
_types.flac = {
|
||||
size: info[4].toLocaleUpperCase(),
|
||||
}
|
||||
break
|
||||
case '320':
|
||||
types.push({ type: '320k', size: info[4] })
|
||||
_types['320k'] = {
|
||||
size: info[4].toLocaleUpperCase(),
|
||||
}
|
||||
break
|
||||
case '192':
|
||||
case '128':
|
||||
types.push({ type: '128k', size: info[4] })
|
||||
_types['128k'] = {
|
||||
size: info[4].toLocaleUpperCase(),
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
types.reverse()
|
||||
|
||||
let interval = parseInt(info.DURATION)
|
||||
|
@ -105,6 +97,7 @@ export default {
|
|||
typeUrl: {},
|
||||
})
|
||||
}
|
||||
// console.log(result)
|
||||
return result
|
||||
},
|
||||
search(str, page = 1, { limit } = {}, retryNum = 0) {
|
||||
|
|
|
@ -21,7 +21,7 @@ export default {
|
|||
},
|
||||
],
|
||||
regExps: {
|
||||
mInfo: /bitrate:(\d+),format:(\w+),size:([\w.]+)/,
|
||||
mInfo: /level:(\w+),bitrate:(\d+),format:(\w+),size:([\w.]+)/,
|
||||
// http://www.kuwo.cn/playlist_detail/2886046289
|
||||
// https://m.kuwo.cn/h5app/playlist/2736267853?t=qqfriend
|
||||
listDetailLink: /^.+\/playlist(?:_detail)?\/(\d+)(?:\?.*|&.*$|#.*$|$)/,
|
||||
|
@ -244,34 +244,36 @@ export default {
|
|||
filterListDetail(rawData) {
|
||||
// console.log(rawData)
|
||||
return rawData.map(item => {
|
||||
let infoArr = item.MINFO.split(';')
|
||||
let infoArr = item.N_MINFO.split(';')
|
||||
let types = []
|
||||
let _types = {}
|
||||
for (let info of infoArr) {
|
||||
info = info.match(this.regExps.mInfo)
|
||||
if (info) {
|
||||
switch (info[2]) {
|
||||
case 'flac':
|
||||
types.push({ type: 'flac', size: info[3] })
|
||||
_types.flac = {
|
||||
size: info[3].toLocaleUpperCase(),
|
||||
case '4000':
|
||||
types.push({ type: 'flac32bit', size: info[4] })
|
||||
_types.flac32bit = {
|
||||
size: info[4].toLocaleUpperCase(),
|
||||
}
|
||||
break
|
||||
case 'mp3':
|
||||
switch (info[1]) {
|
||||
case '320':
|
||||
types.push({ type: '320k', size: info[3] })
|
||||
_types['320k'] = {
|
||||
size: info[3].toLocaleUpperCase(),
|
||||
}
|
||||
break
|
||||
case '192':
|
||||
case '128':
|
||||
types.push({ type: '128k', size: info[3] })
|
||||
_types['128k'] = {
|
||||
size: info[3].toLocaleUpperCase(),
|
||||
}
|
||||
break
|
||||
case '2000':
|
||||
types.push({ type: 'flac', size: info[4] })
|
||||
_types.flac = {
|
||||
size: info[4].toLocaleUpperCase(),
|
||||
}
|
||||
break
|
||||
case '320':
|
||||
types.push({ type: '320k', size: info[4] })
|
||||
_types['320k'] = {
|
||||
size: info[4].toLocaleUpperCase(),
|
||||
}
|
||||
break
|
||||
case '192':
|
||||
case '128':
|
||||
types.push({ type: '128k', size: info[4] })
|
||||
_types['128k'] = {
|
||||
size: info[4].toLocaleUpperCase(),
|
||||
}
|
||||
break
|
||||
}
|
||||
|
|
|
@ -62,22 +62,31 @@ export default {
|
|||
bangid: 128,
|
||||
},
|
||||
],
|
||||
getUrl(id, period, limit) {
|
||||
return `https://u.y.qq.com/cgi-bin/musicu.fcg?format=json&inCharset=utf8&outCharset=utf-8&platform=yqq.json&needNewCode=0&data=${encodeURIComponent(JSON.stringify({
|
||||
comm: {
|
||||
cv: 1602,
|
||||
ct: 20,
|
||||
listDetailRequest(id, period, limit) {
|
||||
// console.log(id, period, limit)
|
||||
return httpFetch('https://u.y.qq.com/cgi-bin/musicu.fcg', {
|
||||
method: 'post',
|
||||
headers: {
|
||||
'User-Agent': 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)',
|
||||
},
|
||||
toplist: {
|
||||
module: 'musicToplist.ToplistInfoServer',
|
||||
method: 'GetDetail',
|
||||
param: {
|
||||
topid: id,
|
||||
num: limit,
|
||||
period,
|
||||
body: {
|
||||
toplist: {
|
||||
module: 'musicToplist.ToplistInfoServer',
|
||||
method: 'GetDetail',
|
||||
param: {
|
||||
topid: id,
|
||||
num: limit,
|
||||
period,
|
||||
},
|
||||
},
|
||||
comm: {
|
||||
uin: 0,
|
||||
format: 'json',
|
||||
ct: 20,
|
||||
cv: 1859,
|
||||
},
|
||||
},
|
||||
}))}`
|
||||
}).promise
|
||||
},
|
||||
regExps: {
|
||||
periodList: /<i class="play_cover__btn c_tx_link js_icon_play" data-listkey=".+?" data-listname=".+?" data-tid=".+?" data-date=".+?" .+?<\/i>/g,
|
||||
|
@ -121,13 +130,6 @@ export default {
|
|||
size,
|
||||
}
|
||||
}
|
||||
if (item.file.size_ape !== 0) {
|
||||
let size = sizeFormate(item.file.size_ape)
|
||||
types.push({ type: 'ape', size })
|
||||
_types.ape = {
|
||||
size,
|
||||
}
|
||||
}
|
||||
if (item.file.size_flac !== 0) {
|
||||
let size = sizeFormate(item.file.size_flac)
|
||||
types.push({ type: 'flac', size })
|
||||
|
@ -135,6 +137,13 @@ export default {
|
|||
size,
|
||||
}
|
||||
}
|
||||
if (item.file.size_hires !== 0) {
|
||||
let size = sizeFormate(item.file.size_hires)
|
||||
types.push({ type: 'flac32bit', size })
|
||||
_types.flac32bit = {
|
||||
size,
|
||||
}
|
||||
}
|
||||
// types.reverse()
|
||||
return {
|
||||
singer: this.getSinger(item.singer),
|
||||
|
@ -223,7 +232,7 @@ export default {
|
|||
let info = this.periods[bangid]
|
||||
let p = info ? Promise.resolve(info.period) : this.getPeriods(bangid)
|
||||
return p.then(period => {
|
||||
return this.getData(this.getUrl(bangid, period, this.limit)).then(resp => {
|
||||
return this.listDetailRequest(bangid, period, this.limit).then(resp => {
|
||||
if (resp.body.code !== 0) return this.getList(bangid, page, retryNum)
|
||||
return {
|
||||
total: resp.body.toplist.data.songInfoList.length,
|
||||
|
|
|
@ -6,7 +6,7 @@ import { formatPlayTime, sizeFormate } from '../../index'
|
|||
// import { formatSinger } from './util'
|
||||
|
||||
export default {
|
||||
limit: 30,
|
||||
limit: 50,
|
||||
total: 0,
|
||||
page: 0,
|
||||
allPage: 1,
|
||||
|
@ -14,11 +14,35 @@ export default {
|
|||
musicSearch(str, page, limit, retryNum = 0) {
|
||||
if (retryNum > 5) return Promise.reject(new Error('搜索失败'))
|
||||
// searchRequest = httpFetch(`https://c.y.qq.com/soso/fcgi-bin/client_search_cp?ct=24&qqmusic_ver=1298&new_json=1&remoteplace=sizer.yqq.song_next&searchid=49252838123499591&t=0&aggr=1&cr=1&catZhida=1&lossless=0&flag_qc=0&p=${page}&n=${limit}&w=${encodeURIComponent(str)}&loginUin=0&hostUin=0&format=json&inCharset=utf8&outCharset=utf-8¬ice=0&platform=yqq&needNewCode=0`)
|
||||
const searchRequest = httpFetch(`https://shc.y.qq.com/soso/fcgi-bin/client_search_cp?ct=24&qqmusic_ver=1298&remoteplace=txt.yqq.top&aggr=1&cr=1&catZhida=1&lossless=0&flag_qc=0&p=${page}&n=${limit}&w=${encodeURIComponent(str)}&cv=4747474&ct=24&format=json&inCharset=utf-8&outCharset=utf-8¬ice=0&platform=yqq.json&needNewCode=0&uin=0&hostUin=0&loginUin=0`)
|
||||
// const searchRequest = httpFetch(`https://shc.y.qq.com/soso/fcgi-bin/client_search_cp?ct=24&qqmusic_ver=1298&remoteplace=txt.yqq.top&aggr=1&cr=1&catZhida=1&lossless=0&flag_qc=0&p=${page}&n=${limit}&w=${encodeURIComponent(str)}&cv=4747474&ct=24&format=json&inCharset=utf-8&outCharset=utf-8¬ice=0&platform=yqq.json&needNewCode=0&uin=0&hostUin=0&loginUin=0`)
|
||||
const searchRequest = httpFetch('https://u.y.qq.com/cgi-bin/musicu.fcg', {
|
||||
method: 'post',
|
||||
headers: {
|
||||
'User-Agent': 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)',
|
||||
},
|
||||
body: {
|
||||
comm: {
|
||||
ct: '19',
|
||||
cv: '1859',
|
||||
uin: '0',
|
||||
},
|
||||
req: {
|
||||
method: 'DoSearchForQQMusicDesktop',
|
||||
module: 'music.search.SearchCgiService',
|
||||
param: {
|
||||
grp: 1,
|
||||
num_per_page: limit,
|
||||
page_num: page,
|
||||
query: str,
|
||||
search_type: 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
// searchRequest = httpFetch(`http://ioscdn.kugou.com/api/v3/search/song?keyword=${encodeURIComponent(str)}&page=${page}&pagesize=${this.limit}&showtype=10&plat=2&version=7910&tag=1&correct=1&privilege=1&sver=5`)
|
||||
return searchRequest.promise.then(({ body }) => {
|
||||
if (body.code !== this.successCode) return this.musicSearch(str, page, limit, ++retryNum)
|
||||
return body.data
|
||||
if (body.code != this.successCode || body.req.code != this.successCode) return this.musicSearch(str, page, limit, ++retryNum)
|
||||
return body.req.data
|
||||
})
|
||||
},
|
||||
getSinger(singers) {
|
||||
|
@ -32,69 +56,75 @@ export default {
|
|||
// console.log(rawList)
|
||||
const list = []
|
||||
rawList.forEach(item => {
|
||||
if (!item.strMediaMid) return
|
||||
if (!item.file?.media_mid) return
|
||||
|
||||
let types = []
|
||||
let _types = {}
|
||||
if (item.size128 !== 0) {
|
||||
let size = sizeFormate(item.size128)
|
||||
const file = item.file
|
||||
if (file.size_128mp3 != 0) {
|
||||
let size = sizeFormate(file.size_128mp3)
|
||||
types.push({ type: '128k', size })
|
||||
_types['128k'] = {
|
||||
size,
|
||||
}
|
||||
}
|
||||
if (item.size320 !== 0) {
|
||||
let size = sizeFormate(item.size320)
|
||||
if (file.size_320mp3 !== 0) {
|
||||
let size = sizeFormate(file.size_320mp3)
|
||||
types.push({ type: '320k', size })
|
||||
_types['320k'] = {
|
||||
size,
|
||||
}
|
||||
}
|
||||
if (item.sizeape !== 0) {
|
||||
let size = sizeFormate(item.sizeape)
|
||||
types.push({ type: 'ape', size })
|
||||
_types.ape = {
|
||||
size,
|
||||
}
|
||||
}
|
||||
if (item.sizeflac !== 0) {
|
||||
let size = sizeFormate(item.sizeflac)
|
||||
if (file.size_flac !== 0) {
|
||||
let size = sizeFormate(file.size_flac)
|
||||
types.push({ type: 'flac', size })
|
||||
_types.flac = {
|
||||
size,
|
||||
}
|
||||
}
|
||||
if (file.size_hires !== 0) {
|
||||
let size = sizeFormate(file.size_hires)
|
||||
types.push({ type: 'flac32bit', size })
|
||||
_types.flac32bit = {
|
||||
size,
|
||||
}
|
||||
}
|
||||
// types.reverse()
|
||||
let albumId = ''
|
||||
let albumName = ''
|
||||
if (item.album) {
|
||||
albumName = item.album.title
|
||||
albumId = item.album.mid
|
||||
}
|
||||
list.push({
|
||||
singer: this.getSinger(item.singer),
|
||||
name: item.songname,
|
||||
albumName: item.albumname,
|
||||
albumId: item.albummid,
|
||||
name: item.title,
|
||||
albumName,
|
||||
albumId,
|
||||
source: 'tx',
|
||||
interval: formatPlayTime(item.interval),
|
||||
songId: item.songid,
|
||||
albumMid: item.albummid,
|
||||
strMediaMid: item.strMediaMid,
|
||||
songmid: item.songmid,
|
||||
img: (item.albummid === '' || item.albummid === '空')
|
||||
songId: item.id,
|
||||
albumMid: item.album?.mid ?? '',
|
||||
strMediaMid: item.file.media_mid,
|
||||
songmid: item.mid,
|
||||
img: (albumId === '' || albumId === '空')
|
||||
? `https://y.gtimg.cn/music/photo_new/T001R500x500M000${item.singer[0]?.mid}.jpg`
|
||||
: `https://y.gtimg.cn/music/photo_new/T002R500x500M000${item.albummid}.jpg`,
|
||||
lrc: null,
|
||||
otherSource: null,
|
||||
: `https://y.gtimg.cn/music/photo_new/T002R500x500M000${albumId}.jpg`,
|
||||
types,
|
||||
_types,
|
||||
typeUrl: {},
|
||||
})
|
||||
})
|
||||
// console.log(list)
|
||||
return list
|
||||
},
|
||||
search(str, page = 1, { limit } = {}) {
|
||||
if (limit == null) limit = this.limit
|
||||
// http://newlyric.kuwo.cn/newlyric.lrc?62355680
|
||||
return this.musicSearch(str, page, limit).then(({ song }) => {
|
||||
let list = this.handleResult(song.list)
|
||||
return this.musicSearch(str, page, limit).then(({ body, meta }) => {
|
||||
let list = this.handleResult(body.song.list)
|
||||
|
||||
this.total = song.totalnum
|
||||
this.total = meta.sum
|
||||
this.page = page
|
||||
this.allPage = Math.ceil(this.total / limit)
|
||||
|
||||
|
|
|
@ -253,13 +253,6 @@ export default {
|
|||
size,
|
||||
}
|
||||
}
|
||||
if (item.file.size_ape !== 0) {
|
||||
let size = sizeFormate(item.file.size_ape)
|
||||
types.push({ type: 'ape', size })
|
||||
_types.ape = {
|
||||
size,
|
||||
}
|
||||
}
|
||||
if (item.file.size_flac !== 0) {
|
||||
let size = sizeFormate(item.file.size_flac)
|
||||
types.push({ type: 'flac', size })
|
||||
|
@ -267,6 +260,13 @@ export default {
|
|||
size,
|
||||
}
|
||||
}
|
||||
if (item.file.size_hires !== 0) {
|
||||
let size = sizeFormate(item.file.size_hires)
|
||||
types.push({ type: 'flac32bit', size })
|
||||
_types.flac32bit = {
|
||||
size,
|
||||
}
|
||||
}
|
||||
// types.reverse()
|
||||
return {
|
||||
singer: this.getSinger(item.singer),
|
||||
|
|
|
@ -9,7 +9,7 @@ import { qualityList } from '@renderer/core/share'
|
|||
* @param {*} type
|
||||
*/
|
||||
|
||||
const types = ['flac', 'wav', 'ape', '320k', '192k', '128k']
|
||||
const types = ['flac32bit', 'flac', 'wav', 'ape', '320k', '192k', '128k']
|
||||
export const getMusicType = (info, type) => {
|
||||
let list = qualityList.value[info.source]
|
||||
if (!list) return '128k'
|
||||
|
|
|
@ -24,27 +24,23 @@ export default {
|
|||
|
||||
switch (privilege.maxbr) {
|
||||
case 999000:
|
||||
size = null
|
||||
size = item.sq ? sizeFormate(item.sq.size) : null
|
||||
types.push({ type: 'flac', size })
|
||||
_types.flac = {
|
||||
size,
|
||||
}
|
||||
case 320000:
|
||||
if (item.h) {
|
||||
size = sizeFormate(item.h.size)
|
||||
types.push({ type: '320k', size })
|
||||
_types['320k'] = {
|
||||
size,
|
||||
}
|
||||
size = item.h ? sizeFormate(item.h.size) : null
|
||||
types.push({ type: '320k', size })
|
||||
_types['320k'] = {
|
||||
size,
|
||||
}
|
||||
case 192000:
|
||||
case 128000:
|
||||
if (item.l) {
|
||||
size = sizeFormate(item.l.size)
|
||||
types.push({ type: '128k', size })
|
||||
_types['128k'] = {
|
||||
size,
|
||||
}
|
||||
size = item.l ? sizeFormate(item.l.size) : null
|
||||
types.push({ type: '128k', size })
|
||||
_types['128k'] = {
|
||||
size,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,6 +62,7 @@ export default {
|
|||
typeUrl: {},
|
||||
})
|
||||
})
|
||||
// console.log(list)
|
||||
return list
|
||||
},
|
||||
async getList(ids = [], retryNum = 0) {
|
||||
|
|
|
@ -35,27 +35,23 @@ export default {
|
|||
let size
|
||||
switch (item.privilege.maxbr) {
|
||||
case 999000:
|
||||
size = null
|
||||
size = item.sq ? sizeFormate(item.sq.size) : null
|
||||
types.push({ type: 'flac', size })
|
||||
_types.flac = {
|
||||
size,
|
||||
}
|
||||
case 320000:
|
||||
if (item.h) {
|
||||
size = sizeFormate(item.h.size)
|
||||
types.push({ type: '320k', size })
|
||||
_types['320k'] = {
|
||||
size,
|
||||
}
|
||||
size = item.h ? sizeFormate(item.h.size) : null
|
||||
types.push({ type: '320k', size })
|
||||
_types['320k'] = {
|
||||
size,
|
||||
}
|
||||
case 192000:
|
||||
case 128000:
|
||||
if (item.l) {
|
||||
size = sizeFormate(item.l.size)
|
||||
types.push({ type: '128k', size })
|
||||
_types['128k'] = {
|
||||
size,
|
||||
}
|
||||
size = item.l ? sizeFormate(item.l.size) : null
|
||||
types.push({ type: '128k', size })
|
||||
_types['128k'] = {
|
||||
size,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -84,6 +80,7 @@ export default {
|
|||
// console.log(result)
|
||||
if (!result || result.code !== 200) return this.search(str, page, { limit }, retryNum)
|
||||
let list = this.handleResult(result.result.songs || [])
|
||||
// console.log(list)
|
||||
|
||||
if (list == null) return this.search(str, page, { limit }, retryNum)
|
||||
|
||||
|
|
|
@ -152,21 +152,17 @@ export default {
|
|||
size,
|
||||
}
|
||||
case 320000:
|
||||
if (item.h) {
|
||||
size = sizeFormate(item.h.size)
|
||||
types.push({ type: '320k', size })
|
||||
_types['320k'] = {
|
||||
size,
|
||||
}
|
||||
size = item.h ? sizeFormate(item.h.size) : null
|
||||
types.push({ type: '320k', size })
|
||||
_types['320k'] = {
|
||||
size,
|
||||
}
|
||||
case 192000:
|
||||
case 128000:
|
||||
if (item.l) {
|
||||
size = sizeFormate(item.l.size)
|
||||
types.push({ type: '128k', size })
|
||||
_types['128k'] = {
|
||||
size,
|
||||
}
|
||||
size = item.l ? sizeFormate(item.l.size) : null
|
||||
types.push({ type: '128k', size })
|
||||
_types['128k'] = {
|
||||
size,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,13 +27,13 @@ export const setAllowShowUserApiUpdateAlert = (id, enable) => {
|
|||
export const saveMyList = data => {
|
||||
rendererSend(NAMES.mainWindow.save_playlist, {
|
||||
type: 'myList',
|
||||
data,
|
||||
data: JSON.stringify(data),
|
||||
})
|
||||
}
|
||||
export const saveDownloadList = list => {
|
||||
rendererSend(NAMES.mainWindow.save_playlist, {
|
||||
type: 'downloadList',
|
||||
data: list,
|
||||
data: JSON.stringify(list),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ div(:class="$style.download")
|
|||
span.select {{item.name}}
|
||||
div.list-item-cell(style="width: 20%;") {{item.progress.progress}}%
|
||||
div.list-item-cell(style="width: 22%;" :aria-label="item.statusText") {{item.statusText}}
|
||||
div.list-item-cell(style="width: 10%;") {{item.metadata.type && item.metadata.type.toUpperCase()}}
|
||||
div.list-item-cell(style="width: 10%;") {{getTypeName(item.metadata.type)}}
|
||||
div.list-item-cell(style="width: 13%; padding-left: 0; padding-right: 0;")
|
||||
material-list-buttons(:index="index" :download-btn="false" :file-btn="item.status != downloadStatus.ERROR" remove-btn
|
||||
:start-btn="!item.isComplate && item.status != downloadStatus.WAITING && (item.status != downloadStatus.RUN)"
|
||||
|
@ -482,6 +482,9 @@ export default {
|
|||
openUrl(url)
|
||||
}
|
||||
},
|
||||
getTypeName(type) {
|
||||
return type == 'flac32bit' ? 'FLAC Hires' : type?.toUpperCase()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -13,10 +13,10 @@ export default ({ props, list, selectedList, removeAllSelect }) => {
|
|||
} else {
|
||||
selectedNum.value = 0
|
||||
musicInfo.value = list.value[index]
|
||||
nextTick(() => {
|
||||
isShowMusicSortModal.value = true
|
||||
})
|
||||
}
|
||||
nextTick(() => {
|
||||
isShowMusicSortModal.value = true
|
||||
})
|
||||
}
|
||||
|
||||
const sortMusic = num => {
|
||||
|
|
Loading…
Reference in New Issue