Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Commit

Permalink
v1.0.30 quick release
Browse files Browse the repository at this point in the history
Quick successor to 1.0.25 which fixes refresh bug affecting sound menu indicator events
Snap support added
  • Loading branch information
Quacky2200 committed Jan 14, 2017
1 parent 4391d56 commit f9ecb19
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
3 changes: 0 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ App = (function(){
get VERSION(){
return electron.app.getVersion();
}
print(str){
console.log(str);
}
static get names(){
return {
process: 'spotifywebplayer',
Expand Down
3 changes: 3 additions & 0 deletions dbus.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ module.exports = function(appName){
on(name, func){
this._player.on(name, func);
}
removeAllListeners(){
this._player.removeAllListeners();
}
set position(pos) {
if (pos !== this.position) this._player.position = pos;
}
Expand Down
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "spotifywebplayer",
"productName": "Spotify Web Player for Linux",
"version": "1.0.25",
"version": "1.0.30",
"description": "An Electron wrapper of Spotify Web Player to increase desktop integration for a stable Spotify Player for Linux replacement",
"main": "main.js",
"postinstall": "install-app-deps",
Expand All @@ -21,8 +21,7 @@
"**/*",
"!spotifywebplayer",
"!*.md",
"!*.sh",
"!libs/electron"
"!*.sh"
],
"extraResources": [
"plugins/libpepflashplayer-${arch}.so"
Expand All @@ -43,10 +42,15 @@
"target": [
"AppImage",
"deb",
"zip"
"zip",
"snap"
]
}
},
"snap": {
"confinement": "devmode",
"grade": "stable"
},
"repository": {
"type": "git",
"url": "git+https://github.com/electron/electron-quick-start.git"
Expand Down
8 changes: 8 additions & 0 deletions windows/spotify/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ module.exports = (function() {
});

if (dbus) {
this.dispose();

dbus.mediakeys.on('Play', () => this.playPause());
dbus.mediakeys.on('Stop', () => this.stop());
dbus.mediakeys.on('Next', () => this.next());
Expand All @@ -132,6 +134,12 @@ module.exports = (function() {
dbus.mpris.on('position', (track,pos) => {console.log('SetPosition not yet implemented')});
}
}
dispose(){
if(dbus){
dbus.mediakeys.removeAllListeners();
dbus.mpris.removeAllListeners();
}
}
pause() {
if(this.status == 'Playing') this.playPause();
}
Expand Down
6 changes: 3 additions & 3 deletions windows/spotify/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = (function() {
//Syncronously read a theme
let loadTheme = function(name, cb){
props.getUTF8File(`${props.paths.themes}/${name}-theme.css`, (err, newcss) => {
if (err) return console.error(err);
if (err) return cb(err);
CURRENT_THEME.THEME_CACHE = `/* Theme Styling */\n${newcss}`;
CURRENT_THEME.THEME_NAME = name;
cb(err);
Expand All @@ -41,7 +41,7 @@ module.exports = (function() {
constructor(){
//Load the base theme
props.getUTF8File(`${__dirname}/base-theme.css`, (err, data) => {
if (err) return;
if (err) return console.error(err);
CURRENT_THEME.BASETHEME_CACHE = `/* Base Theming */\n${data}`;
})
//Load current theme into cache
Expand All @@ -58,7 +58,7 @@ module.exports = (function() {
//However, make sure to set the theme if it
if (name == CURRENT_THEME.THEME_NAME || name == this.themeName) return;
this.isThemeAvailable(name, (err) => {
if (err) return;
if (err) return console.error(err);
props.settings.Theme = name;
props.settings.save();
loadTheme(name, (err) => {
Expand Down
1 change: 1 addition & 0 deletions windows/spotify/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ document.onreadystatechange = function(){
props.spotify.minimize();
return false;
}
controller.dispose();
appMenu.toggleMenu(false);
tray.toggleTray(false);
};
Expand Down

0 comments on commit f9ecb19

Please sign in to comment.