Skip to content

Commit

Permalink
Merge pull request #11 from N0chteil/master
Browse files Browse the repository at this point in the history
πŸ‘¨β€πŸ­ Special character fix
  • Loading branch information
AngryKiller authored Jun 6, 2021
2 parents d7e4799 + 1aeb11d commit 0d84b9a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion itunes-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ function runScript(req, type, args, isJson) {
switch(type){
case "fetch": {
if(isJson) {
return JSON.parse(execSync('cscript //Nologo ' + iTunesFetcherScpt + ' ' + req, { encoding: 'utf8'}));
return JSON.parse(decodeURIComponent(execSync('cscript //Nologo ' + iTunesFetcherScpt + ' ' + req, { encoding: 'utf8'})));
}else{
return execSync('cscript //Nologo ' + iTunesFetcherScpt+' ' + req, { encoding: 'utf8'});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "itunes-bridge",
"version": "0.6.6",
"version": "0.6.7",
"description": "A macOS and Windows NodeJS package to control and get informations from iTunes and macOS Music app through AppleScript",
"main": "itunes-bridge.js",
"repository": {
Expand Down
10 changes: 5 additions & 5 deletions wscript/iTunesFetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ function getCurrentTrack(){
}
}
json = {
"name": currentTrack.name,
"artist": currentTrack.artist,
"album": currentTrack.album,
"name": encodeURIComponent(currentTrack.name),
"artist": encodeURIComponent(currentTrack.artist),
"album": encodeURIComponent(currentTrack.album),
"mediaKind": currentTrack.kind,
"duration": currentTrack.duration,
"elapsedTime": iTunesApp.PlayerPosition,
"remainingTime": remainingTime,
"genre": currentTrack.genre,
"genre": encodeURIComponent(currentTrack.genre),
"releaseYear": currentTrack.year,
"id": currentTrack.name, // I haven't found a way to get the current track ID with iTunes COM :/
"id": encodeURIComponent(currentTrack.name), // I haven't found a way to get the current track ID with iTunes COM :/
"playerState": playerState
};
} catch (e) {
Expand Down

0 comments on commit 0d84b9a

Please sign in to comment.