Torrent selection

This commit is contained in:
DC
2016-03-10 23:39:38 -08:00
parent 5238f2164e
commit 9c8478dbe4
4 changed files with 53 additions and 28 deletions

View File

@@ -170,13 +170,16 @@ function dispatch (action, ...args) {
seed(args[0] /* files */)
}
if (action === 'openPlayer') {
openPlayer(args[0] /* infoHash */)
openPlayer(args[0] /* torrentSummary */)
}
if (action === 'toggleTorrent') {
toggleTorrent(args[0] /* infoHash */)
toggleTorrent(args[0] /* torrentSummary */)
}
if (action === 'deleteTorrent') {
deleteTorrent(args[0] /* infoHash */)
deleteTorrent(args[0] /* torrentSummary */)
}
if (action === 'toggleSelectTorrent') {
toggleSelectTorrent(args[0] /* infoHash */)
}
if (action === 'openChromecast') {
openChromecast(args[0] /* infoHash */)
@@ -555,6 +558,12 @@ function deleteTorrent (torrentSummary) {
playInterfaceSound(config.SOUND_DELETE)
}
function toggleSelectTorrent (infoHash) {
// toggle selection
state.selectedInfoHash = state.selectedInfoHash === infoHash ? null : infoHash
update()
}
function openChromecast (infoHash) {
var torrentSummary = getTorrentSummary(infoHash)
state.devices.chromecast.play(state.server.networkURL, {