Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👨‍🏭 Special character fix #11

Merged
merged 2 commits into from
Jun 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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