diff options
Diffstat (limited to 'lib/torrent.js')
-rw-r--r-- | lib/torrent.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index 1d3607b..0db32e3 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -25,7 +25,6 @@ const speedometer = require('speedometer') const utMetadata = require('ut_metadata') const utPex = require('ut_pex') // browser exclude const utp = require('utp-native') // browser exclude -const parseRange = require('parse-numeric-range') const File = require('./file') const Peer = require('./peer') @@ -486,10 +485,12 @@ class Torrent extends EventEmitter { // Select only specified files (BEP53) http://www.bittorrent.org/beps/bep_0053.html if (this.so) { - const selectOnlyFiles = parseRange(this.so) - this.files.forEach((v, i) => { - if (selectOnlyFiles.includes(i)) this.files[i].select(true) + if (this.so.includes(i)) { + this.files[i].select() + } else { + this.files[i].deselect() + } }) } else { // start off selecting the entire torrent with low priority |