script/bitlove-enclosures.js: torrent stats in link title

This commit is contained in:
Astro 2014-10-11 02:38:36 +02:00
parent 388a051df3
commit 40ac471b90
1 changed files with 8 additions and 0 deletions

View File

@ -95,6 +95,14 @@ $(document).ready(function() {
if (info && torrent) {
var a = $('<a type="application/x-bittorrent" class="torrent mime">Torrent</a>');
a.attr('href', torrent);
var title = info.seeders + " Seeder, " + info.leechers + " Leecher";
if (info.downloaded == 1) {
title += ", 1 Download";
} else if (info.downloaded > 1) {
title += ", " + info.downloaded + " Downloads";
}
a.attr('title', title);
li.append(" ");
li.append(a);
}