@@ -93,6 +93,10 @@ module.exports = class PlaybackController {
|
|||||||
|
|
||||||
// Skip (aka seek) to a specific point, in seconds
|
// Skip (aka seek) to a specific point, in seconds
|
||||||
skipTo (time) {
|
skipTo (time) {
|
||||||
|
if (!Number.isFinite(time)) {
|
||||||
|
console.error('Tried to skip to a non-finite time ' + time)
|
||||||
|
return console.trace()
|
||||||
|
}
|
||||||
if (isCasting(this.state)) Cast.seek(time)
|
if (isCasting(this.state)) Cast.seek(time)
|
||||||
else this.state.playing.jumpToTime = time
|
else this.state.playing.jumpToTime = time
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ function deleteFile (path) {
|
|||||||
// Delete all files in a torrent
|
// Delete all files in a torrent
|
||||||
function moveItemToTrash (torrentSummary) {
|
function moveItemToTrash (torrentSummary) {
|
||||||
var filePath = TorrentSummary.getFileOrFolder(torrentSummary)
|
var filePath = TorrentSummary.getFileOrFolder(torrentSummary)
|
||||||
ipcRenderer.send('moveItemToTrash', filePath)
|
if (filePath) ipcRenderer.send('moveItemToTrash', filePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
function showItemInFolder (torrentSummary) {
|
function showItemInFolder (torrentSummary) {
|
||||||
|
|||||||
@@ -396,7 +396,9 @@ function stop () {
|
|||||||
|
|
||||||
function stoppedCasting () {
|
function stoppedCasting () {
|
||||||
state.playing.location = 'local'
|
state.playing.location = 'local'
|
||||||
state.playing.jumpToTime = state.playing.currentTime
|
state.playing.jumpToTime = Number.isFinite(state.playing.currentTime)
|
||||||
|
? state.playing.currentTime
|
||||||
|
: 0
|
||||||
update()
|
update()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,5 +52,6 @@ function getByKey (state, torrentKey) {
|
|||||||
// module. Store root folder explicitly to avoid hacky path processing below.
|
// module. Store root folder explicitly to avoid hacky path processing below.
|
||||||
function getFileOrFolder (torrentSummary) {
|
function getFileOrFolder (torrentSummary) {
|
||||||
var ts = torrentSummary
|
var ts = torrentSummary
|
||||||
|
if (!ts.path || !ts.files || ts.files.length === 0) return null
|
||||||
return path.join(ts.path, ts.files[0].path.split('/')[0])
|
return path.join(ts.path, ts.files[0].path.split('/')[0])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user