Permalink
Browse files

torrent.title -> torrent.name (for consistency)

  • Loading branch information...
1 parent 96c634d commit 948d2ce7f28093a5f8e91a6fc1572046028fff50 @feross feross committed Feb 26, 2014
Showing with 11 additions and 13 deletions.
  1. +4 −6 lib/app.js
  2. +6 −6 lib/torrent.js
  3. +1 −1 views/torrent.html
View
@@ -135,17 +135,15 @@ App.prototype.updateTorrentUI = function ($torrent, torrent) {
else
$torrent.removeClass('has-metadata')
- $torrent.find('.title').text(torrent.title)
+ $torrent.find('.name').text(torrent.name)
$torrent.find('.downloaded').text(humanize.filesize(torrent.swarm.downloaded))
$torrent.find('.uploaded').text(humanize.filesize(torrent.swarm.uploaded))
$torrent.find('.ratio').text(torrent.swarm.ratio)
$torrent.find('progress').attr('value', torrent.progress)
$torrent.find('.numPeers').text(torrent.swarm.numConns + torrent.swarm.numQueued)
$torrent.find('.numActivePeers').text(torrent.swarm.numPeers)
- $torrent.find('.downloadSpeed')
- .text(humanize.filesize(torrent.swarm.downloadSpeed()))
- $torrent.find('.uploadSpeed')
- .text(humanize.filesize(torrent.swarm.uploadSpeed()))
+ $torrent.find('.downloadSpeed').text(humanize.filesize(torrent.swarm.downloadSpeed()))
+ $torrent.find('.uploadSpeed').text(humanize.filesize(torrent.swarm.uploadSpeed()))
}
App.prototype.downloadTorrentFile = function (torrent) {
@@ -159,7 +157,7 @@ App.prototype.downloadTorrentFile = function (torrent) {
chrome.fileSystem.chooseEntry({
type: 'saveFile',
- suggestedName: torrent.title + '.torrent'
+ suggestedName: torrent.name + '.torrent'
}, function (fileEntry) {
if (!fileEntry)
return
View
@@ -26,16 +26,16 @@ function Torrent (uri, opts) {
throw new Error('invalid torrent uri')
self.infoHash = info.infoHash
- self.title = info.title
-
- self.metadataRaw = null
- self.metadata = null
self.file = null
+ self.name = info.name
self.peerId = opts.peerId
self.torrentPort = opts.torrentPort
self.dhtPort = opts.dhtPort
+ self.metadataRaw = null
+ self.metadata = null
+
self.swarm = new Swarm(self.infoHash, self.peerId, { dht: true })
if (self.torrentPort) {
@@ -212,14 +212,14 @@ Torrent.prototype.onMetadata = function () {
//
/**
- * Given a magnet URI, return infoHash and title
+ * Given a magnet URI, return infoHash and name
* @param {string} uri
* @return {Object}
*/
function parseMagnetUri (uri) {
var parsed = magnet(uri)
return {
- title: parsed.dn, // displayName
+ name: parsed.dn, // displayName
infoHash: parsed.xt && parsed.xt.split('urn:btih:')[1]
}
}
View
@@ -3,7 +3,7 @@
<img class="image" src="img/folder.png">
</div>
<div class="right">
- <div class="title"></div>
+ <div class="name"></div>
<div class="stats">
<span class="if-metadata">
<span class="downloaded"></span>, uploaded <span class="uploaded"></span> (Ratio: <span class="ratio"></span>)

0 comments on commit 948d2ce

Please sign in to comment.