Remove: NowPlaying on Windows

This commit is contained in:
Cutls
2019-08-14 01:23:25 +09:00
parent 8aac6474da
commit 2346ef7089
27 changed files with 42 additions and 343 deletions

View File

@@ -8,19 +8,7 @@ function np(mainWindow) {
//Verified on Windows
console.log("Access");
if (args[0] == "set") {
var { NowPlaying, PlayerName } = require("nowplaying-node");
var nppath = join(app.getPath("userData"), "nowplaying");
var npProvider;
try {
npProvider = args[1];
} catch (e) {
npProvider = "AIMP";
}
var myAIMP = new NowPlaying({
fetchCover: true,
player: PlayerName[npProvider],
});
fs.writeFileSync(nppath, npProvider);
} else {
var platform = process.platform;
var bit = process.arch;
@@ -34,35 +22,6 @@ function np(mainWindow) {
console.error(error);
e.sender.webContents.send('itunes-np', error);
}
} else {
var { NowPlaying, PlayerName } = require("nowplaying-node");
var nppath = join(app.getPath("userData"), "nowplaying");
var npProvider;
try {
npProvider = fs.readFileSync(nppath, 'utf8');
} catch (e) {
npProvider = "AIMP";
}
var myAIMP = new NowPlaying({
fetchCover: true,
player: PlayerName[npProvider],
});
myAIMP.update();
var path = myAIMP.getCoverPath();
if (path) {
var bin = fs.readFileSync(path, 'base64');
} else {
var bin = false;
}
var value = {
win: true,
name: myAIMP.getTitle(),
artist: myAIMP.getArtist(),
album: myAIMP.getAlbum(),
path: bin
}
e.sender.webContents.send('itunes-np', value);
}
}