Skip to content

Commit 1cf0f2d

Browse files
committed
Merge branch 'dev'
2 parents 379c752 + 25a0439 commit 1cf0f2d

19 files changed

Lines changed: 1805 additions & 2598 deletions

File tree

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,25 @@ Project versioning adheres to [Semantic Versioning](http://semver.org/).
66
Commit convention is based on [Conventional Commits](http://conventionalcommits.org).
77
Change log format is based on [Keep a Changelog](http://keepachangelog.com/).
88

9+
## [1.15.1](https://github.com/lyswhut/lx-music-desktop/compare/v1.15.0...v1.15.1) - 2021-11-09
10+
11+
### 优化
12+
13+
- 优化我的列表、下载列表等列表的滚动流畅度
14+
- 优化下载功能的批量添加、删除、暂停任务时的流畅度,现在进行这些操作应该不会再觉得卡顿了
15+
- 支持启动软件时恢复播放下载列表里的歌曲
16+
- 添加媒体播放进度条的信息设置
17+
18+
### 修复
19+
20+
- 修复某些情况下获取URL失败时会意外切歌的问题
21+
- 修复了某些情况下会列表同步失败,导致连接断开无限重连或一直卡在 `syncing...` 的问题
22+
- 修复列表数据过大导致同步失败的问题
23+
24+
### 其他
25+
26+
- 更新electron到v15.3.1(这修复了媒体控制失效的问题)
27+
928
## [1.15.0](https://github.com/lyswhut/lx-music-desktop/compare/v1.14.1...v1.15.0) - 2021-10-29
1029

1130
### 新增

FAQ.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656

5757
播放在线列表内的歌曲需要将它们都添加到我的列表才能播放,你可以全选列表内的歌曲然后添加到现有列表或者新创建的列表,然后去播放该列表内的歌曲。
5858

59+
从v1.10.0起,你可以右击排行榜名字的弹出菜单中直接播放或收藏整个排行榜的歌曲。
60+
5961
## 无法打开外部歌单
6062

6163
不支持跨源打开歌单,请**确认**你需要打开的歌单平台是否与软件标签所写的**歌单源**对应(不一样的话请通过右上角切换歌单源);<br>
@@ -142,7 +144,7 @@
142144

143145
注:v1.6.0及之后的版本才支持`-dha`参数
144146

145-
## Window 7 下软件启动后,界面无法显示
147+
## Windows 7 下软件启动后,界面无法显示
146148

147149
对于软件启动后,可以在任务栏看到软件,但软件界面在桌面上无任何显示,或者整个界面偶尔闪烁的情况。<br>
148150
原始问题看:<https://github.com/electron/electron/issues/19569#issuecomment-522231083><br>

package-lock.json

Lines changed: 1269 additions & 2287 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lx-music-desktop",
3-
"version": "1.15.0",
3+
"version": "1.15.1",
44
"description": "一个免费的音乐查找助手",
55
"main": "./dist/electron/main.js",
66
"productName": "lx-music-desktop",
@@ -167,31 +167,31 @@
167167
},
168168
"homepage": "https://github.com/lyswhut/lx-music-desktop#readme",
169169
"devDependencies": {
170-
"@babel/core": "^7.15.8",
171-
"@babel/plugin-proposal-class-properties": "^7.14.5",
170+
"@babel/core": "^7.16.0",
171+
"@babel/plugin-proposal-class-properties": "^7.16.0",
172172
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
173-
"@babel/plugin-transform-modules-umd": "^7.14.5",
174-
"@babel/plugin-transform-runtime": "^7.15.8",
173+
"@babel/plugin-transform-modules-umd": "^7.16.0",
174+
"@babel/plugin-transform-runtime": "^7.16.0",
175175
"@babel/polyfill": "^7.12.1",
176-
"@babel/preset-env": "^7.15.8",
176+
"@babel/preset-env": "^7.16.0",
177177
"babel-eslint": "^10.1.0",
178178
"babel-loader": "^8.2.3",
179179
"babel-preset-minify": "^0.5.1",
180-
"browserslist": "^4.17.5",
180+
"browserslist": "^4.17.6",
181181
"cfonts": "^2.10.0",
182182
"chalk": "^4.1.2",
183183
"changelog-parser": "^2.8.0",
184184
"copy-webpack-plugin": "^9.0.1",
185-
"core-js": "^3.19.0",
185+
"core-js": "^3.19.1",
186186
"cross-env": "^7.0.3",
187-
"css-loader": "^6.5.0",
188-
"css-minimizer-webpack-plugin": "^3.1.1",
187+
"css-loader": "^6.5.1",
188+
"css-minimizer-webpack-plugin": "^3.1.2",
189189
"del": "^6.0.0",
190-
"electron": "^15.3.0",
190+
"electron": "^15.3.1",
191191
"electron-builder": "^22.11.7",
192192
"electron-debug": "^3.2.0",
193193
"electron-devtools-installer": "^3.2.0",
194-
"electron-to-chromium": "^1.3.884",
194+
"electron-to-chromium": "^1.3.891",
195195
"eslint": "^7.32.0",
196196
"eslint-config-standard": "^16.0.3",
197197
"eslint-formatter-friendly": "^7.0.0",
@@ -208,7 +208,7 @@
208208
"less-loader": "^10.2.0",
209209
"less-plugin-clean-css": "^1.5.1",
210210
"markdown-it": "^12.2.0",
211-
"mini-css-extract-plugin": "^2.4.3",
211+
"mini-css-extract-plugin": "^2.4.4",
212212
"node-loader": "^2.0.0",
213213
"postcss": "^8.3.11",
214214
"postcss-loader": "^6.2.0",
@@ -219,11 +219,11 @@
219219
"raw-loader": "^4.0.2",
220220
"rimraf": "^3.0.2",
221221
"spinnies": "^0.5.1",
222-
"terser-webpack-plugin": "^5.2.4",
222+
"terser-webpack-plugin": "^5.2.5",
223223
"url-loader": "^4.1.1",
224224
"vue-loader": "^15.9.8",
225225
"vue-template-compiler": "^2.6.14",
226-
"webpack": "^5.60.0",
226+
"webpack": "^5.62.1",
227227
"webpack-cli": "^4.9.1",
228228
"webpack-dev-server": "^3.11.2",
229229
"webpack-hot-middleware": "^2.25.1",
@@ -240,14 +240,14 @@
240240
"iconv-lite": "^0.6.3",
241241
"image-size": "^1.0.0",
242242
"koa": "^2.13.4",
243-
"long": "^5.0.1",
243+
"long": "^5.1.0",
244244
"needle": "^3.0.0",
245245
"node-id3": "^0.2.3",
246246
"request": "^2.88.2",
247-
"socket.io": "^4.3.1",
247+
"socket.io": "^4.3.2",
248248
"utf-8-validate": "^5.0.7",
249249
"vue": "^2.6.14",
250-
"vue-i18n": "^8.26.5",
250+
"vue-i18n": "^8.26.7",
251251
"vue-router": "^3.5.3",
252252
"vuex": "^3.6.2"
253253
}

publish/changeLog.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
1-
### 新增
2-
3-
- 添加黑色托盘图标
4-
- 自定义源新增`version`字段,新增`utils.buffer.bufToString`方法
5-
61
### 优化
72

8-
- 大幅优化我的列表、下载、歌单、排行榜列表性能,现在即使同一列表内的歌曲很多时也不会卡顿了
9-
- 优化列表同步代码逻辑
10-
- 优化开关评论时的动画性能
11-
- 优化进入、离开播放详情页的性能
12-
- 兼容桌面歌词以触摸的方式移动、调整大小
13-
- 调整图标尺寸
3+
- 优化我的列表、下载列表等列表的滚动流畅度
4+
- 优化下载功能的批量添加、删除、暂停任务时的流畅度,现在进行这些操作应该不会再觉得卡顿了
5+
- 支持启动软件时恢复播放下载列表里的歌曲
6+
- 添加媒体播放进度条的信息设置
147

158
### 修复
169

17-
- 修复kg源的歌单链接无法打开的问题
18-
- 修复同一首歌的URL、歌词等同时需要换源时的处理问题
10+
- 修复某些情况下获取URL失败时会意外切歌的问题
11+
- 修复了某些情况下会列表同步失败,导致连接断开无限重连或一直卡在 `syncing...` 的问题
12+
- 修复列表数据过大导致同步失败的问题
1913

2014
### 其他
2115

22-
- 更新 Electron 到 v15.3.0
16+
- 更新electron到v15.3.1(这修复了媒体控制失效的问题)

publish/version.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/common/utils.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,6 @@ exports.initSetting = isShowErrorAlert => {
153153
// 迁移列表滚动位置设置 ~0.18.3
154154
if (setting.list.scroll) {
155155
let scroll = setting.list.scroll
156-
// electronStore_list.set('defaultList.location', scroll.locations.default || 0)
157-
// electronStore_list.set('loveList.location', scroll.locations.love || 0)
158156
electronStore_config.delete('setting.list.scroll')
159157
electronStore_config.set('setting.list.isSaveScrollLocation', scroll.enable)
160158
delete setting.list.scroll

src/main/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const { isMac, isLinux, initHotKey } = require('../common/utils')
4646
// https://github.com/electron/electron/issues/18397
4747
// 开发模式下为true时 多次引入native模块会导致渲染进程卡死
4848
// https://github.com/electron/electron/issues/22791
49-
app.allowRendererProcessReuse = !isDev
49+
// app.allowRendererProcessReuse = !isDev
5050

5151

5252
app.on('web-contents-created', (event, contents) => {

src/main/modules/sync/server/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const handleStartServer = (port = 9527) => new Promise((resolve, reject) => {
7272
serveClient: false,
7373
connectTimeout: 10000,
7474
pingTimeout: 30000,
75-
maxHttpBufferSize: 3e6,
75+
maxHttpBufferSize: 1e9, // 1G
7676
allowRequest: authConnection,
7777
transports: ['websocket'],
7878
})

src/main/modules/sync/server/syncList.js

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ let io
1111
let syncingId = null
1212
const wait = (time = 1000) => new Promise((resolve, reject) => setTimeout(resolve, time))
1313

14+
const patchListData = listData => {
15+
return Object.assign({}, {
16+
defaultList: {
17+
id: 'default',
18+
name: '试听列表',
19+
list: [],
20+
},
21+
loveList: {
22+
id: 'love',
23+
name: '我的收藏',
24+
list: [],
25+
},
26+
userList: [],
27+
}, listData)
28+
}
29+
1430
const getRemoteListData = socket => new Promise((resolve, reject) => {
1531
console.log('getRemoteListData')
1632
const handleError = reason => {
@@ -23,7 +39,7 @@ const getRemoteListData = socket => new Promise((resolve, reject) => {
2339
const data = JSON.parse(decryptMsg(socket.data.keyInfo, enData))
2440
if (!data) return reject(new Error('Get remote list data failed'))
2541
if (data.action != 'getData') return
26-
resolve(data.data)
42+
resolve(patchListData(data.data))
2743
}
2844

2945
socket.on('disconnect', handleError)
@@ -35,7 +51,7 @@ const getLocalListData = () => new Promise((resolve, reject) => {
3551
const handleSuccess = ({ action, data }) => {
3652
if (action !== 'getData') return
3753
global.lx_event.sync.off(SYNC_EVENT_NAMES.sync_handle_list, handleSuccess)
38-
resolve(data)
54+
resolve(patchListData(data))
3955
}
4056
global.lx_event.sync.on(SYNC_EVENT_NAMES.sync_handle_list, handleSuccess)
4157
global.lx_event.sync.sync_list({
@@ -87,10 +103,10 @@ const updateSnapshot = (path, data) => {
87103
}
88104

89105

90-
const createListDataObj = listData => {
91-
const listDataObj = {}
92-
for (const list of listData.userList) listDataObj[list.id] = list
93-
return listDataObj
106+
const createUserListDataObj = listData => {
107+
const userListDataObj = {}
108+
for (const list of listData.userList) userListDataObj[list.id] = list
109+
return userListDataObj
94110
}
95111

96112
const handleMergeList = (sourceList, targetList, addMusicLocationType) => {
@@ -137,11 +153,11 @@ const mergeList = (sourceListData, targetListData) => {
137153
newListData.defaultList = handleMergeList(sourceListData.defaultList, targetListData.defaultList, addMusicLocationType)
138154
newListData.loveList = handleMergeList(sourceListData.loveList, targetListData.loveList, addMusicLocationType)
139155

140-
const listDataObj = createListDataObj(sourceListData)
156+
const userListDataObj = createUserListDataObj(sourceListData)
141157
newListData.userList = [...sourceListData.userList]
142158

143159
for (const list of targetListData.userList) {
144-
const targetList = listDataObj[list.id]
160+
const targetList = userListDataObj[list.id]
145161
if (targetList) {
146162
targetList.list = handleMergeList(targetList, list, addMusicLocationType).list
147163
} else {
@@ -156,11 +172,11 @@ const overwriteList = (sourceListData, targetListData) => {
156172
newListData.defaultList = sourceListData.defaultList
157173
newListData.loveList = sourceListData.loveList
158174

159-
const listDataObj = createListDataObj(sourceListData)
175+
const userListDataObj = createUserListDataObj(sourceListData)
160176
newListData.userList = [...sourceListData.userList]
161177

162178
for (const list of targetListData.userList) {
163-
const targetList = listDataObj[list.id]
179+
const targetList = userListDataObj[list.id]
164180
if (targetList) continue
165181
newListData.userList.push(list)
166182
}
@@ -259,8 +275,10 @@ const mergeListDataFromSnapshot = (sourceList, targetList, snapshotList, addMusi
259275
const targetListItemIds = new Set()
260276
for (const m of sourceList.list) sourceListItemIds.add(m.songmid)
261277
for (const m of targetList.list) targetListItemIds.add(m.songmid)
262-
for (const m of snapshotList.list) {
263-
if (!sourceListItemIds.has(m.songmid) || !targetListItemIds.has(m.songmid)) removedListIds.add(m.songmid)
278+
if (snapshotList) {
279+
for (const m of snapshotList.list) {
280+
if (!sourceListItemIds.has(m.songmid) || !targetListItemIds.has(m.songmid)) removedListIds.add(m.songmid)
281+
}
264282
}
265283

266284
let newList
@@ -294,13 +312,12 @@ const mergeListDataFromSnapshot = (sourceList, targetList, snapshotList, addMusi
294312
const handleMergeListDataFromSnapshot = async(socket, snapshot) => {
295313
const addMusicLocationType = global.appSetting.list.addMusicLocationType
296314
const [remoteListData, localListData] = await Promise.all([getRemoteListData(socket), getLocalListData()])
297-
console.log('handleMergeListDataFromSnapshot', 'remoteListData, localListData')
298315
const newListData = {}
299316
newListData.defaultList = mergeListDataFromSnapshot(localListData.defaultList, remoteListData.defaultList, snapshot.defaultList, addMusicLocationType)
300317
newListData.loveList = mergeListDataFromSnapshot(localListData.loveList, remoteListData.loveList, snapshot.loveList, addMusicLocationType)
301-
const localUserListData = createListDataObj(localListData)
302-
const remoteUserListData = createListDataObj(remoteListData)
303-
const snapshotUserListData = createListDataObj(snapshot)
318+
const localUserListData = createUserListDataObj(localListData)
319+
const remoteUserListData = createUserListDataObj(remoteListData)
320+
const snapshotUserListData = createUserListDataObj(snapshot)
304321
const removedListIds = new Set()
305322
const localUserListIds = new Set()
306323
const remoteUserListIds = new Set()
@@ -367,7 +384,7 @@ const syncList = async socket => {
367384
}
368385
console.log('isSyncRequired', isSyncRequired)
369386
if (isSyncRequired) return handleSyncList(socket)
370-
return handleMergeListDataFromSnapshot(socket, fileData)
387+
return handleMergeListDataFromSnapshot(socket, patchListData(fileData))
371388
}
372389

373390
const checkSyncQueue = async() => {

0 commit comments

Comments
 (0)