Skip to content

Commit

Permalink
Bug fix for missing initial folder and playback bug fixes. (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikssource committed Dec 16, 2018
1 parent 605cd18 commit 929ceb8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "podpup",
"version": "0.0.1",
"version": "0.0.2",
"author": "Erik Larson <erik@welarson.com>",
"description": "An electron-vue project",
"license": "GPL-3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/EpisodeList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:items="episodes"
striped >
<template slot="details" slot-scope="data">
<b-button size="sm" v-on:click.stop="data.toggleDetails" >
<b-button size="sm" v-on:click="data.toggleDetails" >
<i class="fas fa-file-alt"></i>
</b-button>
</template>
Expand Down
14 changes: 9 additions & 5 deletions src/renderer/components/Player.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
isplaying: false,
duration: 0,
progress: 0,
soundid: 0,
updateTimer: null
}
},
Expand All @@ -72,11 +73,11 @@
playpause: function(event) {
if (this.$data.playstate === 'Play') {
this.$data.playstate = 'Pause'
this.$data.audioplayer.play()
this.$data.soundid = this.$data.audioplayer.play(this.$data.soundid)
}
else {
this.$data.playstate = 'Play'
this.$data.audioplayer.pause()
this.$data.audioplayer.pause(this.$data.soundid)
}
},
formatDuration: function(durationInSecs) {
Expand All @@ -93,7 +94,7 @@
if (this.$data.audioplayer) {
let seekpoint = Math.round(((Math.max(this.$data.progress,1))/2000) * this.$data.duration)
console.log("Setting Seekpoint: ", seekpoint)
this.$data.audioplayer.seek(seekpoint)
this.$data.audioplayer.seek(seekpoint, this.$data.soundid)
this.$data.updateTimer = setInterval(() => {
this.$data.progress = calcProgress(this.$data.audioplayer.seek(), this.$data.duration)
}, 500)
Expand All @@ -102,6 +103,9 @@
},
watch: {
playingEpisode: function(newEpisode, oldEpisode) {
if (oldEpisode && newEpisode.id === oldEpisode.id) {
return;
}
// Make sure I'm hooked up to the media key
mediakeys.registerPlaypauseHandler((() => {
this.playpause(null)
Expand Down Expand Up @@ -129,10 +133,10 @@
src: [src],
preload: true,
html5: true,
volume: 0.7
volume: 0.9
})
this.$data.duration = newEpisode.duration
this.$data.audioplayer.play()
this.$data.soundid = this.$data.audioplayer.play()
this.$data.isplaying = true
this.$data.playstate = 'Pause'
this.$data.progress = calcProgress(this.$data.audioplayer.seek(), this.$data.duration)
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/store/db/poddao.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ import Vue from 'vue'
import Sequelize from 'sequelize'
import * as Promise from 'bluebird'
import path from 'path'
import fs from 'fs'

import config from '../modules/config'

if (!fs.existsSync(config.state.poddir)) {
fs.mkdirSync(config.state.poddir, {recursive: true})
}

const sequelize = new Sequelize('poddb', null, null, {
dialect: 'sqlite',
storage: path.join(config.state.poddir, 'podpup.db')
Expand Down

0 comments on commit 929ceb8

Please sign in to comment.