Metadata: call getImage in front

This commit is contained in:
TC
2021-04-03 11:34:55 +02:00
parent fecb193ded
commit 533b8a8cb7
2 changed files with 5 additions and 1 deletions

View File

@ -1,9 +1,12 @@
const { ipcRenderer } = require("electron"); const { ipcRenderer } = require("electron");
const { getImage } = require("./song-info");
global.songInfo = {}; global.songInfo = {};
ipcRenderer.on("update-song-info", (_, extractedSongInfo) => { ipcRenderer.on("update-song-info", async (_, extractedSongInfo) => {
global.songInfo = JSON.parse(extractedSongInfo); global.songInfo = JSON.parse(extractedSongInfo);
global.songInfo.image = await getImage(global.songInfo.imageSrc);
}); });
const injectListener = () => { const injectListener = () => {

View File

@ -90,3 +90,4 @@ const registerProvider = (win) => {
}; };
module.exports = registerProvider; module.exports = registerProvider;
module.exports.getImage = getImage;