Skip to content

Commit

Permalink
fix previous track still playing for 1 second on next + fix on suspend
Browse files Browse the repository at this point in the history
  • Loading branch information
sneljo1 committed Aug 26, 2018
1 parent fdb365d commit f38121e
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 198 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ matrix:
- libgtk2.0-0
- libnss3
- libasound2
- libdbus-1-dev
- libglib2.0-dev
- libgconf-2-4
- libdbus-1-dev:i386
- libdbus-glib-1-dev
- os: osx
language: node_js
osx_image: xcode9.0
Expand Down Expand Up @@ -54,6 +58,7 @@ install:
- |
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
export DISPLAY=':99.0'
export DBUS_SESSION_BUS_ADDRESS='unix:path=/run/dbus/system_bus_socket'
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
sleep 3
fi
Expand Down
184 changes: 0 additions & 184 deletions changelog.md

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"description": "Electron application boilerplate based on React, React Router, Webpack, React Hot Loader for rapid application development",
"main": "main.js",
"scripts": {
"prebuild": "rebuild-node-sass",
"prebuild": "rebuild-node-sass && electron-rebuild",
"build-test": "cross-env NODE_ENV=test BABEL_DISABLE_CACHE=1 npm run build-main && npm run build-renderer",
"test": "cross-env NODE_ENV=test BABEL_DISABLE_CACHE=1 mocha --retries 2 --compilers js:babel-register --recursive --require test/**/*.spec.js",
"test-watch": "npm test -- --watch",
Expand Down Expand Up @@ -153,6 +153,7 @@
"electron": "^2.0.0",
"electron-builder": "^20.28.2",
"electron-devtools-installer": "^2.0.1",
"electron-rebuild": "^1.8.2",
"enzyme": "^2.7.1",
"eslint": "^5.2.0",
"eslint-config-airbnb": "^17.0.0",
Expand Down
4 changes: 1 addition & 3 deletions src/main/features/PowerMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ export default class PowerMonitor extends IFeature {
}

pause = () => {
if (!this.app.mainWindow) {
this.router.send(EVENTS.PLAYER.TOGGLE_STATUS, PLAYER_STATUS.PAUSED);
}
this.router.send(EVENTS.PLAYER.TOGGLE_STATUS, PLAYER_STATUS.PAUSED);
}

unregister() {
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"@nodert-win10/windows.media": "^0.2.95",
"@nodert-win10/windows.media.playback": "^0.2.95",
"@nodert-win10/windows.storage.streams": "^0.2.95",
"dbus": "GPMDP/node-dbus#linux-only",
"dbus": "1.0.3",
"electron-media-service": "^0.2.2",
"mpris-service": "GPMDP/mpris-service"
},
Expand Down
6 changes: 2 additions & 4 deletions src/renderer/modules/player/components/audio/Audio.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class Audio extends Component {

if (url !== nextProps.url || id !== nextProps.id) {
this.startStream(nextProps.url)
} else if (playStatus !== nextProps.playStatus) {
this.toggleStatus(nextProps.playStatus)
}

if (this.player.getState() === 'playing' && !this.player.isActuallyPlaying()) {
Expand All @@ -40,10 +42,6 @@ class Audio extends Component {
}
}

if (playStatus !== nextProps.playStatus) {
this.toggleStatus(nextProps.playStatus)
}

if (volume !== nextProps.volume && this.player) {
this.player.setVolume(nextProps.volume)
}
Expand Down
1 change: 0 additions & 1 deletion src/shared/actions/player/playerActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ export function setCurrentPlaylist(playlistId, next_track) {

return playlist.tracks.map(trackId => {
if (track_entities[trackId] && !track_entities[trackId].streamable) {
console.log("not streamable", track_entities[id])
return null;
}

Expand Down
6 changes: 6 additions & 0 deletions src/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,12 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"

[email protected]:
version "1.0.3"
resolved "https://registry.yarnpkg.com/dbus/-/dbus-1.0.3.tgz#bceda148673bc2fcca2042ba06a95965762689bc"
dependencies:
nan "^2.1.0"

dbus@GPMDP/node-dbus#linux-only:
version "0.2.18"
resolved "https://codeload.github.com/GPMDP/node-dbus/tar.gz/e35f87d0fcd472b352af236061d28abe78379dc8"
Expand Down
Loading

0 comments on commit f38121e

Please sign in to comment.