Download & other bug fixes

This commit is contained in:
exttex
2020-10-01 14:30:00 +02:00
parent 80f6cbf870
commit 9b4aca64e3
8 changed files with 42 additions and 24 deletions

View File

@ -7,6 +7,7 @@ import VueEsc from 'vue-esc';
import VueSocketIO from 'vue-socket.io';
//Globals
let ipcRenderer;
//Axios
let axiosInstance = axios.create({
baseURL: `${window.location.origin}`,
@ -226,7 +227,7 @@ new Vue({
this.position = this.audio.currentTime * 1000;
//Gapless playback
if (this.position >= (this.duration() - 5000) && this.state == 2) {
if (this.position >= (this.duration() - 7000) && this.state == 2) {
if (!this.shuffle && this.repeat != 2)
this.loadGapless();
}
@ -364,7 +365,6 @@ new Vue({
//Update settings in electron
if (this.settings.electron) {
const {ipcRenderer} = window.require('electron');
ipcRenderer.send('updateSettings', this.settings);
}
},
@ -422,7 +422,6 @@ new Vue({
//Update in electron
if (this.settings.electron) {
const {ipcRenderer} = window.require('electron');
ipcRenderer.send('playing', this.state == 2);
}
}
@ -455,11 +454,11 @@ new Vue({
typeof navigator === 'object' && typeof navigator.userAgent === 'string' &&
navigator.userAgent.indexOf('Electron') >= 0
));
if (this.settings.electron)
ipcRenderer = window.require('electron').ipcRenderer;
//Setup electron callbacks
if (this.settings.electron) {
const {ipcRenderer} = window.require('electron');
//Save files on exit
ipcRenderer.on('onExit', async () => {
this.pause();

View File

@ -101,7 +101,7 @@
:prepend-icon='$root.muted ? "mdi-volume-off" : "mdi-volume-high"'
max='1.00'
step='0.01'
v-model='$root.audio.volume'
v-model='$root.volume'
class='px-8'
style='padding-top: 2px;'
@change='updateVolume'
@ -283,6 +283,7 @@ export default {
},
//Save volume
updateVolume(v) {
if (this.$root.audio) this.$root.audio.volume = v;
this.$root.volume = v;
},
//Repeat button click
@ -305,7 +306,7 @@ export default {
},
'$root.position'() {
if (!this.seeking) this.position = this.$root.position / 1000;
}
},
}
};