Skip to content

Commit

Permalink
made it so full file paths are returned
Browse files Browse the repository at this point in the history
  • Loading branch information
deoxxa committed Apr 5, 2012
1 parent 41eb2f2 commit 1fff268
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/torrent-util.js
Expand Up @@ -159,7 +159,7 @@ exports.get_files = function(torrent) {
if (typeof torrent.info.files == "object" && torrent.info.files instanceof Array) { if (typeof torrent.info.files == "object" && torrent.info.files instanceof Array) {
return torrent.info.files.map(function(file) { return torrent.info.files.map(function(file) {
if (typeof file != "object") { return; } if (typeof file != "object") { return; }
if (typeof file.path == "object" && file.path instanceof Array) { file.path = file.path.shift(); } if (typeof file.path == "object" && file.path instanceof Array) { file.path = file.path.join("/"); }
if (typeof file.path == "object" && Buffer.isBuffer(file.path)) { file.path = file.path.toString(); } if (typeof file.path == "object" && Buffer.isBuffer(file.path)) { file.path = file.path.toString(); }
if (typeof file.path != "string" || typeof file.length != "number") { return; } if (typeof file.path != "string" || typeof file.length != "number") { return; }


Expand Down

0 comments on commit 1fff268

Please sign in to comment.