feat: use osdlyrics dbus interface to send lyric contents

This commit is contained in:
Revincx 2023-08-26 08:53:32 +08:00
parent 845bc8a921
commit ed1daab1f6
No known key found for this signature in database
GPG key ID: 6E79B88F79CA3126
8 changed files with 45 additions and 55 deletions

View file

@ -629,16 +629,17 @@ export default class {
return ipcRenderer?.send('metadata', metadata);
}
let lyricName = track.ar.map(ar => ar.name).join(', ') + '-' + track.name;
let lyricContent = await getLyric(track.id);
if (!lyricContent.lrc.lyric) {
if (!lyricContent.lrc || !lyricContent.lrc.lyric) {
return ipcRenderer?.send('metadata', metadata);
}
ipcRenderer.send('saveLyric', {
name: lyricName,
lyric: lyricContent.lrc.lyric,
ipcRenderer.send('sendLyrics', {
track,
lyrics: lyricContent.lrc.lyric,
});
ipcRenderer.on('saveLyricFinished', () => {
ipcRenderer?.send('metadata', metadata);
});