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");
|
media(arg.path, "image/png", "new");
|
||||||
}
|
}
|
||||||
} else if (platform == "darwin") {
|
} else if (platform == "darwin") {
|
||||||
if (flag && arg.existsArtwork) {
|
if (flag && arg.artwork) {
|
||||||
media(arg.artworks[0].data, "image/png", "new");
|
media(arg.artwork, "image/png", "new");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var regExp = new RegExp("{song}", "g");
|
var regExp = new RegExp("{song}", "g");
|
||||||
|
|
|
@ -15,10 +15,11 @@ function np(mainWindow) {
|
||||||
if (platform == "darwin") {
|
if (platform == "darwin") {
|
||||||
try {
|
try {
|
||||||
const nowplaying = require("itunes-nowplaying-mac");
|
const nowplaying = require("itunes-nowplaying-mac");
|
||||||
const value = await nowplaying();
|
let value = await nowplaying();
|
||||||
|
|
||||||
const artwork = await nowplaying.getThumbnailBuffer(value.databaseID);
|
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);
|
e.sender.webContents.send('itunes-np', value);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// エラーを返す
|
// エラーを返す
|
||||||
|
|
Loading…
Reference in New Issue
Block a user