fixes
This commit is contained in:
@@ -156,8 +156,7 @@ module.exports = class TorrentListController {
|
|||||||
|
|
||||||
prioritizeTorrent (infoHash) {
|
prioritizeTorrent (infoHash) {
|
||||||
this.state.saved.torrents
|
this.state.saved.torrents
|
||||||
.filter(torrent => // We're interested in active torrents only.
|
.filter(torrent => ['downloading', 'seeding'].includes(torrent.status)) // Active torrents only.
|
||||||
['downloading', 'seeding'].indexOf(torrent.status) !== -1)
|
|
||||||
.forEach((torrent) => { // Pause all active torrents except the one that started playing.
|
.forEach((torrent) => { // Pause all active torrents except the one that started playing.
|
||||||
if (infoHash === torrent.infoHash) return
|
if (infoHash === torrent.infoHash) return
|
||||||
|
|
||||||
|
|||||||
@@ -19,10 +19,7 @@ const config = require('../../config')
|
|||||||
const { CastingError } = require('./errors')
|
const { CastingError } = require('./errors')
|
||||||
|
|
||||||
// Lazy load these for a ~300ms improvement in startup time
|
// Lazy load these for a ~300ms improvement in startup time
|
||||||
let airplayer
|
let airplayer, chromecasts, dlnacasts
|
||||||
|
|
||||||
let chromecasts
|
|
||||||
let dlnacasts
|
|
||||||
|
|
||||||
// App state. Cast modifies state.playing and state.errors in response to events
|
// App state. Cast modifies state.playing and state.errors in response to events
|
||||||
let state
|
let state
|
||||||
|
|||||||
@@ -61,9 +61,7 @@ function migrate_0_7_0 (saved) {
|
|||||||
// * Then, relative paths for the default torrents, eg '../static/sintel.torrent'
|
// * Then, relative paths for the default torrents, eg '../static/sintel.torrent'
|
||||||
// * Then, paths computed at runtime for default torrents, eg 'sintel.torrent'
|
// * Then, paths computed at runtime for default torrents, eg 'sintel.torrent'
|
||||||
// * Finally, now we're getting rid of torrentPath altogether
|
// * Finally, now we're getting rid of torrentPath altogether
|
||||||
let src
|
let src, dst
|
||||||
|
|
||||||
let dst
|
|
||||||
if (ts.torrentPath) {
|
if (ts.torrentPath) {
|
||||||
if (path.isAbsolute(ts.torrentPath) || ts.torrentPath.startsWith('..')) {
|
if (path.isAbsolute(ts.torrentPath) || ts.torrentPath.startsWith('..')) {
|
||||||
src = ts.torrentPath
|
src = ts.torrentPath
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ function torrentPoster (torrent, cb) {
|
|||||||
const bestScore = ['audio', 'video', 'image'].map(mediaType => ({
|
const bestScore = ['audio', 'video', 'image'].map(mediaType => ({
|
||||||
type: mediaType,
|
type: mediaType,
|
||||||
size: calculateDataLengthByExtension(torrent, mediaExtensions[mediaType])
|
size: calculateDataLengthByExtension(torrent, mediaExtensions[mediaType])
|
||||||
})).sort((a, b) => // sort descending on size
|
})).sort((a, b) => b.size - a.size)[0] // sort descending on size
|
||||||
b.size - a.size)[0]
|
|
||||||
|
|
||||||
if (bestScore.size === 0) {
|
if (bestScore.size === 0) {
|
||||||
// Admit defeat, no video, audio or image had a significant presence
|
// Admit defeat, no video, audio or image had a significant presence
|
||||||
|
|||||||
@@ -40,9 +40,7 @@ class CreateTorrentPage extends React.Component {
|
|||||||
|
|
||||||
// Then, use the name of the base folder (or sole file, for a single file torrent)
|
// Then, use the name of the base folder (or sole file, for a single file torrent)
|
||||||
// as the default name. Show all files relative to the base folder.
|
// as the default name. Show all files relative to the base folder.
|
||||||
let defaultName
|
let defaultName, basePath
|
||||||
|
|
||||||
let basePath
|
|
||||||
if (files.length === 1) {
|
if (files.length === 1) {
|
||||||
// Single file torrent: /a/b/foo.jpg -> torrent name 'foo.jpg', path '/a/b'
|
// Single file torrent: /a/b/foo.jpg -> torrent name 'foo.jpg', path '/a/b'
|
||||||
defaultName = files[0].name
|
defaultName = files[0].name
|
||||||
|
|||||||
Reference in New Issue
Block a user