fix np on macos
This commit is contained in:
parent
9957bd9b8a
commit
f50c2d3049
|
@ -134,8 +134,8 @@ function npCore(arg) {
|
|||
media(arg.path, "image/png", "new");
|
||||
}
|
||||
} else if (platform == "darwin") {
|
||||
if (flag && arg.existsArtwork) {
|
||||
media(arg.artworks[0].data, "image/png", "new");
|
||||
if (flag && arg.artwork) {
|
||||
media(arg.artwork, "image/png", "new");
|
||||
}
|
||||
}
|
||||
var regExp = new RegExp("{song}", "g");
|
||||
|
|
|
@ -15,10 +15,11 @@ function np(mainWindow) {
|
|||
if (platform == "darwin") {
|
||||
try {
|
||||
const nowplaying = require("itunes-nowplaying-mac");
|
||||
const value = await nowplaying();
|
||||
let value = await nowplaying();
|
||||
|
||||
const artwork = await nowplaying.getThumbnailBuffer(value.databaseID);
|
||||
console.log(artwork)
|
||||
const base64 = artwork.toString('base64');
|
||||
value.artwork = base64
|
||||
e.sender.webContents.send('itunes-np', value);
|
||||
} catch (error) {
|
||||
// エラーを返す
|
||||
|
|
Loading…
Reference in New Issue
Block a user