Fix bug where file streamed would always be shown when playing local files afterwards

This commit is contained in:
Kylart 2020-08-28 16:52:21 +02:00
parent 5a8e1b8296
commit 592d29c714
3 changed files with 11 additions and 6 deletions

View File

@ -22,7 +22,12 @@ function init (event, { link }) {
const server = createServer(file)
server.listen()
event.sender.send(events.init.success, { torrent: link, name: file.name, path: file.path, port: server.address().port })
event.sender.send(events.init.success, {
link,
name: file.name,
path: file.path,
port: server.address().port
})
})
// Pause/Resume downloading as needed

View File

@ -184,7 +184,8 @@ export default {
this.$store.dispatch('streaming/play', {
link: this.path,
name: this.title,
neighbours: null
neighbours: null,
isTorrent: false
})
} else {
this.$electron.shell.openItem(this.path)

View File

@ -16,13 +16,12 @@ export default {
}
const event = eventsList.streaming.init
const handler = (e, data) => {
ipcRenderer.once(event.success, (e, data) => {
commit('setPlayer', { ...data, show: true, isTorrent })
dispatch('getNeighbours')
ipcRenderer.removeListener(event.success, handler)
}
})
ipcRenderer.on(event.success, handler)
ipcRenderer.send(event.main, opts)
},
getNeighbours ({ rootState, state, commit, rootGetters }) {