Torrent list: fix button alignment
This commit is contained in:
@@ -40,8 +40,8 @@ function init (callback) {
|
|||||||
|
|
||||||
function addChromecastEvents () {
|
function addChromecastEvents () {
|
||||||
state.devices.chromecast.on('error', function (err) {
|
state.devices.chromecast.on('error', function (err) {
|
||||||
err.message = 'Chromecast: ' + err.message
|
state.devices.chromecast.errorMessage = err.message
|
||||||
onError(err)
|
update()
|
||||||
})
|
})
|
||||||
state.devices.chromecast.on('disconnect', function () {
|
state.devices.chromecast.on('disconnect', function () {
|
||||||
state.playing.location = 'local'
|
state.playing.location = 'local'
|
||||||
@@ -53,18 +53,15 @@ function addChromecastEvents () {
|
|||||||
function addAirplayEvents () {}
|
function addAirplayEvents () {}
|
||||||
|
|
||||||
// Update our state from the remote TV
|
// Update our state from the remote TV
|
||||||
function pollCastStatus(state) {
|
function pollCastStatus (state) {
|
||||||
var device
|
var device
|
||||||
if (state.playing.location === 'chromecast') device = state.devices.chromecast
|
if (state.playing.location === 'chromecast') device = state.devices.chromecast
|
||||||
else if (state.playing.location === 'airplay') device = state.devices.airplay
|
else if (state.playing.location === 'airplay') device = state.devices.airplay
|
||||||
else return
|
else return
|
||||||
|
|
||||||
device.status(function (err, status) {
|
device.status(function (err, status) {
|
||||||
if (err) {
|
if (err) return console.log('Error getting %s status: %o', state.playing.location, err)
|
||||||
return console.log('Error retrieving %s status: %o', state.playing.location, err)
|
handleStatus(status)
|
||||||
}
|
|
||||||
console.log('GOT CAST STATUS: %o', status)
|
|
||||||
handleStatus (status)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +76,7 @@ function openChromecast () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
state.playing.location = 'chromecast-pending'
|
state.playing.location = 'chromecast-pending'
|
||||||
var torrentSummary = getTorrentSummary(state.playing.infoHash)
|
var torrentSummary = state.saved.torrents.find((x) => x.infoHash === state.playing.infoHash)
|
||||||
state.devices.chromecast.play(state.server.networkURL, {
|
state.devices.chromecast.play(state.server.networkURL, {
|
||||||
type: 'video/mp4',
|
type: 'video/mp4',
|
||||||
title: config.APP_NAME + ' — ' + torrentSummary.name
|
title: config.APP_NAME + ' — ' + torrentSummary.name
|
||||||
@@ -146,6 +143,6 @@ function getActiveDevice () {
|
|||||||
else throw new Error('getActiveDevice() called, but we\'re not casting')
|
else throw new Error('getActiveDevice() called, but we\'re not casting')
|
||||||
}
|
}
|
||||||
|
|
||||||
function castCallback (err) {
|
function castCallback () {
|
||||||
console.log('CAST CALLBACK: %o', arguments)
|
console.log('Cast callback: %o', arguments)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user