From 4c521aef99227b0711ce5f80ae4c37f7e5d0dda5 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 18:47:52 +0300 Subject: [PATCH] add bittorrent protocol version labels notice --- src/Controller/TorrentController.php | 5 +++++ templates/default/torrent/list.html.twig | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index a168f85..78edd63 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -443,6 +443,11 @@ class TorrentController extends AbstractController [ 'name' => $file->getName(), 'size' => $file->getSize(), + 'hash' => + [ + 'v1' => $file->getInfoHashV1(false), + 'v2' => $file->getInfoHashV2(false) + ], ], 'scrape' => [ diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 8f358df..f4ed3e5 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -28,19 +28,33 @@ {% endif %} {% if torrent.approved == false %} - + {% endif %} {% if torrent.sensitive == true %} - + {% endif %} + {% if torrent.file.hash.v2 %} + + + + + + {% endif %} + {% if torrent.file.hash.v1 and torrent.file.hash.v2 %} + + + + + + {% endif %} {% if torrent.keywords %}