diff options
author | zhanghua000 | 2022-11-04 21:12:43 +0800 |
---|---|---|
committer | zhanghua000 | 2022-11-04 21:12:43 +0800 |
commit | e685c476e58ac6762c78179e0212ba7d5f7500fc (patch) | |
tree | d0ab17a814d748e20ed400410414076def804833 | |
parent | 5c0db540aac7cd6a8f01d230a5b94398e39abc15 (diff) | |
download | aur-e685c476e58ac6762c78179e0212ba7d5f7500fc.tar.gz |
Fix lyric display
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | 01-lyric.diff | 42 | ||||
-rw-r--r-- | PKGBUILD | 8 |
3 files changed, 50 insertions, 4 deletions
@@ -1,7 +1,7 @@ pkgbase = yesplaymusicosd-origin-git pkgdesc = 高颜值的第三方网易云播放器,支持 Windows / macOS / Linux :electron: 支持桌面歌词!(no fork). pkgver = 0.4.5.r41.g9ae65c6 - pkgrel = 2 + pkgrel = 3 url = https://github.com/shih-liang/YesPlayMusicOSD arch = x86_64 arch = aarch64 @@ -31,9 +31,11 @@ pkgbase = yesplaymusicosd-origin-git conflicts = yesplaymusicosd conflicts = yesplaymusic source = git+https://github.com/shih-liang/YesPlayMusicOSD.git + source = 01-lyric.diff source = yesplaymusic.desktop source = yesplaymusic sha256sums = SKIP + sha256sums = f309cc37a283a9396d91056754e734e8f8e56afc82458b35e275d6c5e35efaab sha256sums = 5b53cb0b2dfea09b992671e6e58057264fa4628fd61851d216bd0d7c7f8e0969 sha256sums = 1a668db904a1d8f5c849aace5916d7013949021f44b0ce9c8e40bf4d643821f3 diff --git a/01-lyric.diff b/01-lyric.diff new file mode 100644 index 000000000000..1d5a1325591f --- /dev/null +++ b/01-lyric.diff @@ -0,0 +1,42 @@ +diff --git a/src/background.js b/src/background.js +index 00bff0e..314926f 100644 +--- a/src/background.js ++++ b/src/background.js +@@ -126,6 +126,10 @@ class Background { + 'HardwareMediaKeyHandling,MediaSessionService' + ); + } ++ ++ if (isLinux) { ++ app.commandLine.appendSwitch('use-gl', 'desktop'); ++ } + } + + async initDevtools() { +@@ -290,7 +294,7 @@ class Background { + ); + if (!process.env.IS_TEST) this.osdlyrics.webContents.openDevTools(); + } else { +- this.osdlyrics.loadURL('http://localhost:27232/osdlyrics.html'); ++ this.osdlyrics.loadURL('http://localhost:41342/osdlyrics.html'); + } + } + +@@ -457,7 +461,8 @@ class Background { + } + + handleAppEvents() { +- app.on('ready', async () => { ++ app.on('ready', () => { ++ setTimeout(() => { + // This method will be called when Electron has finished + // initialization and is ready to create browser windows. + // Some APIs can only be used after this event occurs. +@@ -520,6 +525,7 @@ class Background { + if (isCreateMpris) { + createMpris(this.window); + } ++ }, 300); + }); + + app.on('activate', () => { @@ -4,7 +4,7 @@ pkgname=("yesplaymusicosd-origin-git" "yesplaymusicosd-origin-electron-git") pkgver=0.4.5.r41.g9ae65c6 -pkgrel=2 +pkgrel=3 pkgdesc="高颜值的第三方网易云播放器,支持 Windows / macOS / Linux :electron: 支持桌面歌词!(no fork)." arch=("x86_64" "aarch64") url="https://github.com/shih-liang/YesPlayMusicOSD" @@ -18,17 +18,19 @@ makedepends=("git" "libvips" "nodejs=16.16.0" "yarn" "node-gyp") optdepends=('yt-dlp: Youtube source for built-in UnblockNeteaseMusic') source=( "git+https://github.com/shih-liang/YesPlayMusicOSD.git" + "01-lyric.diff" "yesplaymusic.desktop" "yesplaymusic") sha256sums=('SKIP' + 'f309cc37a283a9396d91056754e734e8f8e56afc82458b35e275d6c5e35efaab' '5b53cb0b2dfea09b992671e6e58057264fa4628fd61851d216bd0d7c7f8e0969' '1a668db904a1d8f5c849aace5916d7013949021f44b0ce9c8e40bf4d643821f3') _electron=electron13 prepare(){ cd "${srcdir}/YesPlayMusicOSD" - sed -i 's/27232/41342/' "src/background.js" - # https://github.com/shih-liang/YesPlayMusicOSD/issues/266#issuecomment-1302994727 + git apply "${srcdir}/01-lyric.diff" + # https://github.com/shih-liang/YesPlayMusicOSD/issues/266#issuecomment-1303486341 cp .env.example .env yarn install } |