</p>
{% if peers %}
- <h3>{{ _("Peers") }}</h3>
- {% module TrackerPeerList(peers, percentages=True) %}
- {% end %}
-
- {% if seeds %}
- <h3>{{ _("Seeds") }}</h3>
- {% module TrackerPeerList(seeds) %}
+ <h3>{{ _("Peers & Seeds") }}</h3>
+ {% module TrackerPeerList(peers) %}
{% end %}
{% end block %}
<a href="/{{ torrent.torrent_hash }}">{{ torrent.basename }}</a>
</td>
<td>
- {{ len(torrent.seeders) }}
+ {{ torrent.seeders }}
</td>
<td>
- {{ len(torrent.peers) }}
+ {{ torrent.peers }}
</td>
<td>
<a href="{{ torrent.magnet_link }}">
if not self.torrent_hash:
return
- return self.tracker.get_seeds(self.torrent_hash)
+ return self.backend.tracker.complete(self.torrent_hash)
@property
def peers(self):
if not self.torrent_hash:
return
- return self.tracker.get_peers(self.torrent_hash)
+ return self.backend.tracker.incomplete(self.torrent_hash)
class Release(Object):
raise tornado.web.HTTPError(404, "Could not find torrent file for hash: %s" % torrent_hash)
peers = self.tracker.get_peers(torrent_hash)
- seeds = self.tracker.get_seeds(torrent_hash)
self.render("tracker-torrent-detail.html", release=file.release,
- file=file, peers=peers, seeds=seeds)
+ file=file, peers=peers)
class TrackerDownloadHandler(BaseHandler):
class TrackerPeerListModule(UIModule):
- def render(self, peers, percentages=False):
+ def render(self, peers):
# Guess country code and hostname of the host
for peer in peers:
- country_code = backend.GeoIP().get_country(peer["ip"])
+ country_code = self.geoip.get_country(peer["ip"])
+ if country_code:
+ country_code = country_code.lower()
peer["country_code"] = country_code or "unknown"
try:
peer["hostname"] = ""
return self.render_string("modules/tracker-peerlist.html",
- peers=[Row(p) for p in peers], percentages=percentages)
+ peers=[Row(p) for p in peers])
class StasyTableModule(UIModule):