Cleanup for PR #571
This commit is contained in:
@@ -1015,7 +1015,7 @@ function openPlayer (infoHash, index, cb) {
|
|||||||
var timeout = setTimeout(function () {
|
var timeout = setTimeout(function () {
|
||||||
torrentSummary.playStatus = 'timeout' /* no seeders available? */
|
torrentSummary.playStatus = 'timeout' /* no seeders available? */
|
||||||
sound.play('ERROR')
|
sound.play('ERROR')
|
||||||
cb(new Error('playback timed out'))
|
cb(new Error('Playback timed out. Try again.'))
|
||||||
update()
|
update()
|
||||||
}, 10000) /* give it a few seconds */
|
}, 10000) /* give it a few seconds */
|
||||||
|
|
||||||
|
|||||||
@@ -193,8 +193,14 @@ function TorrentList (state) {
|
|||||||
filesElement = hx`<div class='files warning'>${message}</div>`
|
filesElement = hx`<div class='files warning'>${message}</div>`
|
||||||
} else {
|
} else {
|
||||||
// We do know the files. List them and show download stats for each one
|
// We do know the files. List them and show download stats for each one
|
||||||
var fileRows = torrentSummary.files.sort(fileSortHelper).map(
|
var fileRows = torrentSummary.files
|
||||||
(file, index) => renderFileRow(torrentSummary, file, index))
|
.sort(function (a, b) {
|
||||||
|
if (a.name < b.name) return -1
|
||||||
|
if (b.name < a.name) return 1
|
||||||
|
return 0
|
||||||
|
})
|
||||||
|
.map((file, index) => renderFileRow(torrentSummary, file, index))
|
||||||
|
|
||||||
filesElement = hx`
|
filesElement = hx`
|
||||||
<div class='files'>
|
<div class='files'>
|
||||||
<table>
|
<table>
|
||||||
@@ -211,15 +217,6 @@ function TorrentList (state) {
|
|||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
function fileSortHelper (a, b) {
|
|
||||||
var result = 0
|
|
||||||
if (a.name > b.name) {
|
|
||||||
result = 1
|
|
||||||
} else if (a.name < b.name) {
|
|
||||||
result = -1
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
// Show a single torrentSummary file in the details view for a single torrent
|
// Show a single torrentSummary file in the details view for a single torrent
|
||||||
function renderFileRow (torrentSummary, file, index) {
|
function renderFileRow (torrentSummary, file, index) {
|
||||||
// First, find out how much of the file we've downloaded
|
// First, find out how much of the file we've downloaded
|
||||||
|
|||||||
Reference in New Issue
Block a user