stark81/my_yesplaymusic

[Bugs] 几个问题

zxp19821005 opened this issue · 1 comments

我已经将该软件包移植到了ArchLinux的AUR:my-yesplaymusic-bin,在移植过程中,发现几个问题。

反馈 bug 需要的信息

  • 类型:客户端
  • 操作系统:EndeavourOS 6.1.64-1-lts
  • 0.4.13

Bug

缺少tray-icon.png

$ ./yesplaymusic 
[background.js] initializing
[NetEase API] initiating NCM API
[background.js] creating express app
(node:53375) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `yesplaymusic --trace-deprecation ...` to show where the warning was created)
server running @ http://localhost:10754
[53375:1201/101344.071681:ERROR:object_proxy.cc(590)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.InvalidArgs: 无此接口“org.freedesktop.portal.FileChooser”
[53375:1201/101344.071714:ERROR:select_file_dialog_linux_portal.cc(274)] Failed to read portal version property
[background.js] app ready event
[background.js] creating app window
[background.js] checkForUpdates
APPIMAGE env is not defined, current application is not an AppImage
[globalShortcut.js] registerGlobalShortcut
checkForUpdatesAndNotify called, downloadPromise is null
(node:53375) UnhandledPromiseRejectionWarning: Error: Failed to load image from path '/home/zxp-endeavouros/.cache/paru/clone/my-yesplaymusic-bin/src/opt/YesPlayMusic/resources/app.asar/tray-icon.png'
    at /home/zxp-endeavouros/.cache/paru/clone/my-yesplaymusic-bin/src/opt/YesPlayMusic/resources/app.asar/background.js:2:2522319
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
(node:53375) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:53375) UnhandledPromiseRejectionWarning: Error: Could not connect
    at Socket.o (/home/zxp-endeavouros/.cache/paru/clone/my-yesplaymusic-bin/src/opt/YesPlayMusic/resources/app.asar/background.js:2:2118020)
    at Object.onceWrapper (node:events:628:26)
    at Socket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
(node:53375) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
[background.js] window ready-to-show event
[OK] /song/detail?ids=1478005597
[OK] /album/new?area=all&limit=10
[OK] /toplist/artist
[OK] /lyric?id=1478005597
[OK] /toplist
[OK] /personalized?limit=10
[background.js] window close event
^C[background.js] window close event

这个我将asar解包之后,复制了一个32x32的图标到其根目录,已经解决了。

终端运行报错,但是可以正常运行

目录123是我的临时解包目录

$ electron25 123
[background.js] initializing
[NetEase API] initiating NCM API
[background.js] creating express app
(node:54169) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `electron --trace-deprecation ...` to show where the warning was created)
server running @ http://localhost:10754
[54169:1201/101635.604062:ERROR:object_proxy.cc(590)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.InvalidArgs: 无此接口“org.freedesktop.portal.FileChooser”
[54169:1201/101635.604080:ERROR:select_file_dialog_linux_portal.cc(274)] Failed to read portal version property
[background.js] app ready event
[background.js] creating app window
[background.js] checkForUpdates
APPIMAGE env is not defined, current application is not an AppImage
[globalShortcut.js] registerGlobalShortcut
checkForUpdatesAndNotify called, downloadPromise is null
(node:54169) UnhandledPromiseRejectionWarning: TypeError: Assignment to constant variable.
    at /home/zxp-endeavouros/.cache/paru/clone/my-yesplaymusic-bin/src/opt/YesPlayMusic/resources/123/background.js:2:2522318
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
(node:54169) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:54169) UnhandledPromiseRejectionWarning: Error: Could not connect
    at Socket.o (/home/zxp-endeavouros/.cache/paru/clone/my-yesplaymusic-bin/src/opt/YesPlayMusic/resources/123/background.js:2:2118020)
    at Object.onceWrapper (node:events:628:26)
    at Socket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
(node:54169) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
[background.js] window ready-to-show event
[OK] /song/detail?ids=1478005597
[OK] /album/new?area=all&limit=10
[OK] /toplist
[OK] /lyric?id=1478005597
[OK] /toplist/artist
[OK] /personalized?limit=10

任务栏不显示程序图标

如图
image

系统栏点击图标右键空白,无任何菜单

由于我的截图快捷键和个别软件冲突,暂时无法截图。

建议

  • 能不能将软件包名重新取个名字呢?以便于和暂时停止更新的 https://github.com/qier222/YesPlayMusic 有所区别?
  • 安装好程序之后看了下,配置保存目录依然是 ~/.config/yesplaymusic,这个不知道能不能调整一下呢?可能会和原来安装的yesplaymusic有所冲突。
  1. 缺少tray-icon.png的问题,其实在我Mac、Windows、deepin系统使用serve模式运行的时候也会报这个错误,这个时候dock栏显示的则是electron的默认图标,打包好的软件则正常。也就是说,这个报错其实可以不用管。。
  2. 第2个问题所说的报错,看着像是【检查更新】时报warning了。①这一部分的代码是原程序就有的,我只是把里面用户点击确定更新后的访问地址改成了我的项目地址,所以可能原程序在运行时可能也会报这个warning?②既然是warning,说明不影响使用哈,只是不能自动检查更新而已哈。以后有时间了再去了解并修复这个问题吧。。
  3. 第3点你先试着运行打包程序的命令,然后安装,这样应该可以正常显示图标;
  4. 系统栏点击图标右键空白,无任何菜单”这个问题,目前我这边三个系统都没有问题。但是,我这边windows和deepin系统的系统任务栏里会出现一个正常图标和一个空白图标。我看你最后的截图里QQ右边和搜狗输入法左边都有一个图标,是不是这两个图标都不能右键出现菜单?如果是的话,应该是electron的这个API在你这个系统下无效果?你可以在 src/electron/menu.js 里进行log调试一下,看看具体是什么问题。。
  5. 至于重新取名这个问题。。你可以自己改一下哈,应该是在程序根目录下的 package.json 里,你把name改了应该就可以,这样应该可以解决你后面建议里的两个问题。。