Merge pull request #824 from feross/m/open-partial-files
Don't open partially downloaded files in external app
This commit is contained in:
@@ -38,7 +38,7 @@ module.exports = class PlaybackController {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show a file in the OS, eg in Finder on a Mac
|
// Open a file in OS default app.
|
||||||
openItem (infoHash, index) {
|
openItem (infoHash, index) {
|
||||||
var torrentSummary = TorrentSummary.getByKey(this.state, infoHash)
|
var torrentSummary = TorrentSummary.getByKey(this.state, infoHash)
|
||||||
var filePath = path.join(
|
var filePath = path.join(
|
||||||
|
|||||||
@@ -322,8 +322,11 @@ module.exports = class TorrentList extends React.Component {
|
|||||||
handleClick = dispatcher('playFile', infoHash, index)
|
handleClick = dispatcher('playFile', infoHash, index)
|
||||||
} else {
|
} else {
|
||||||
icon = 'description' /* file icon, opens in OS default app */
|
icon = 'description' /* file icon, opens in OS default app */
|
||||||
handleClick = dispatcher('openItem', infoHash, index)
|
handleClick = isDone
|
||||||
|
? dispatcher('openItem', infoHash, index)
|
||||||
|
: (e) => e.stopPropagation() // noop if file is not ready
|
||||||
}
|
}
|
||||||
|
// TODO: add a css 'disabled' class to indicate that a file cannot be opened/streamed
|
||||||
var rowClass = ''
|
var rowClass = ''
|
||||||
if (!isSelected) rowClass = 'disabled' // File deselected, not being torrented
|
if (!isSelected) rowClass = 'disabled' // File deselected, not being torrented
|
||||||
if (!isDone && !isPlayable) rowClass = 'disabled' // Can't open yet, can't stream
|
if (!isDone && !isPlayable) rowClass = 'disabled' // Can't open yet, can't stream
|
||||||
|
|||||||
Reference in New Issue
Block a user