Skip to content

Commit

Permalink
Fixes #18, #21, #22
Browse files Browse the repository at this point in the history
  • Loading branch information
tma02 committed Aug 2, 2017
1 parent 08c9c25 commit f1940cc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let mainWindow;

function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({width: 1366, height: 790});
mainWindow = new BrowserWindow({width: 1366, height: 790, autoHideMenuBar: true});

// and load the index.html of the app.
mainWindow.loadURL('file://' + __dirname + '/index.html');
Expand Down Expand Up @@ -168,7 +168,7 @@ function getCurrentAlbumId() {
console.log('found new song title.');
currentTitle = data.track.track_resource.name;
console.log('song title:', currentTitle);
getAlbumCover(data.track.album_resource.uri.split(':')[2]);
getAlbumCover(data.track.album_resource.uri);
if (mainWindow !== null) {
mainWindow.webContents.send('title', data.track.track_resource.name);
mainWindow.webContents.send('album', data.track.album_resource.name);
Expand All @@ -185,12 +185,12 @@ function getCurrentAlbumId() {

function getAlbumCover(id) {
config = copyConfig();
config.host = 'api.spotify.com';
config.path = '/v1/albums/' + id;
config.host = 'open.spotify.com';
config.path = '/oembed?url=' + id;
config.port = 443;
getJson(config, function(data) {
console.log('cover url:', data.images[0].url);
coverUrl = data.images[0].url;
console.log('cover url:', data.thumbnail_url);
coverUrl = data.thumbnail_url;
if (mainWindow !== null) {
mainWindow.webContents.send('coverUrl', coverUrl);
}
Expand Down

0 comments on commit f1940cc

Please sign in to comment.