Fix: macOS NP
This commit is contained in:
parent
3ba4dee8a7
commit
d654b63bca
|
@ -141,7 +141,11 @@ function npCore(arg) {
|
||||||
var regExp = new RegExp("{song}", "g");
|
var regExp = new RegExp("{song}", "g");
|
||||||
content = content.replace(regExp, arg.name);
|
content = content.replace(regExp, arg.name);
|
||||||
var regExp = new RegExp("{album}", "g");
|
var regExp = new RegExp("{album}", "g");
|
||||||
content = content.replace(regExp, arg.album);
|
if(arg.album){
|
||||||
|
if(arg.album.name){
|
||||||
|
content = content.replace(regExp, arg.album.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
var regExp = new RegExp("{artist}", "g");
|
var regExp = new RegExp("{artist}", "g");
|
||||||
content = content.replace(regExp, arg.artist);
|
content = content.replace(regExp, arg.artist);
|
||||||
var regExp = new RegExp("{url}", "g");
|
var regExp = new RegExp("{url}", "g");
|
||||||
|
|
|
@ -15,7 +15,7 @@ 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.getRawData();
|
const value = await nowplaying.getData();
|
||||||
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