summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-01-19 20:08:06 +0100
committerDan McGee <dan@archlinux.org>2013-01-19 20:08:06 +0100
commit71c0c7453a5bc28b6e6576fe4f1351139f33ade5 (patch)
tree084d2b13072c539bc28651acf3a6679ff2f09ebe /templates
parent1a7e5d22f1c4e948c624d26b4d8c1ed30189acfe (diff)
downloadarchweb-71c0c7453a5bc28b6e6576fe4f1351139f33ade5.tar.gz
archweb-71c0c7453a5bc28b6e6576fe4f1351139f33ade5.tar.xz
Implement torrent data parsing and extraction via bencode
This allows uploading of the actual torrent file itself into the webapp and then pulling the relevant pieces of information out of it. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'templates')
-rw-r--r--templates/releng/release_detail.html24
1 files changed, 21 insertions, 3 deletions
diff --git a/templates/releng/release_detail.html b/templates/releng/release_detail.html
index fec9ce2..f4de9e5 100644
--- a/templates/releng/release_detail.html
+++ b/templates/releng/release_detail.html
@@ -9,9 +9,10 @@
<li><strong>Release Date:</strong> {{ release.release_date|date }}</li>
{% if release.kernel_version %}<li><strong>Kernel Version:</strong> {{ release.kernel_version }}</li>{% endif %}
<li><strong>Available:</strong> {{ release.available|yesno }}</li>
- {% if release.available %}<li><a href="https://www.archlinux.org/{{ release.iso_url }}.torrent"
- title="Download torrent for {{ release.version }}">Torrent</a></li>{% endif %}
- {% if release.available %}<li><a href="{{ release.magnet_uri }}">Magnet</a></li>{% endif %}
+ {% if release.available %}<li><strong>Download:</strong> <a href="https://www.archlinux.org/{{ release.iso_url }}.torrent"
+ title="Download torrent for {{ release.version }}">Torrent</a>,
+ <a href="{{ release.magnet_uri }}">Magnet</a></li>{% endif %}
+ {% if release.torrent_infohash %}<li><strong>Torrent Info Hash:</strong> {{ release.torrent_infohash }}</li>{% endif %}
<li><strong>Download Size:</strong> {% if release.file_size %}{{ release.file_size|filesizeformat }}{% else %}Unknown{% endif %}</li>
</ul>
@@ -20,5 +21,22 @@
<div class="article-content">{{ release.info_html }}</div>
{% endif %}
+
+ {% if release.torrent_data %}{% with release.torrent as torrent %}
+ <h3>Torrent Information</h3>
+
+ <ul>
+ <li><strong>Comment:</strong> {{ torrent.comment }}</li>
+ <li><strong>Creation Date:</strong> {{ torrent.creation_date|date:"DATETIME_FORMAT" }} UTC</li>
+ <li><strong>Created By:</strong> {{ torrent.created_by }}</li>
+ <li><strong>Announce URL:</strong> {{ torrent.announce }}</li>
+ <li><strong>File Name:</strong> {{ torrent.file_name }}</li>
+ <li><strong>File Length:</strong> {{ torrent.file_length|filesizeformat }}</li>
+ <li><strong>Piece Count:</strong> {{ torrent.piece_count }} pieces</li>
+ <li><strong>Piece Length:</strong> {{ torrent.piece_length|filesizeformat }}</li>
+ <li><strong>Computed Info Hash:</strong> {{ torrent.info_hash }}</li>
+ <li><strong>URL List Length:</strong> {{ torrent.url_list|length }} URLs</li>
+ </ul>
+ {% endwith %}{% endif %}
</div>
{% endblock %}