Browse Source

add scrape info #11

main
ghost 1 year ago
parent
commit
0609d5775f
  1. 6
      src/Controller/TorrentController.php
  2. 31
      templates/default/torrent/info.html.twig

6
src/Controller/TorrentController.php

@ -57,6 +57,12 @@ class TorrentController extends AbstractController
[ [
'id' => $torrent->getId(), 'id' => $torrent->getId(),
'added' => $torrent->getAdded(), 'added' => $torrent->getAdded(),
'scrape' =>
[
'seeders' => (int) $torrent->getSeeders(),
'peers' => (int) $torrent->getPeers(),
'leechers' => (int) $torrent->getLeechers(),
],
'locales' => $torrentService->findLastTorrentLocales($torrent->getId()), 'locales' => $torrentService->findLastTorrentLocales($torrent->getId()),
'sensitive' => $torrentService->findLastTorrentSensitive($torrent->getId())->isValue(), 'sensitive' => $torrentService->findLastTorrentSensitive($torrent->getId())->isValue(),
'download' => 'download' =>

31
templates/default/torrent/info.html.twig

@ -177,6 +177,37 @@
</td> </td>
</tr> </tr>
{% endif %} {% endif %}
<tr>
<td colspan="2">
<div class="padding-y-8-px border-bottom-default text-right">
{{ 'Scrape'|trans }}
</div>
</td>
</tr>
<tr>
<td class="padding-t-16-px">
{{ 'Seeders'|trans }}
</td>
<td class="padding-t-16-px">
{{ torrent.scrape.seeders }}
</td>
</tr>
<tr>
<td>
{{ 'Peers'|trans }}
</td>
<td>
{{ torrent.scrape.peers }}
</td>
</tr>
<tr>
<td>
{{ 'Leechers'|trans }}
</td>
<td>
{{ torrent.scrape.leechers }}
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

Loading…
Cancel
Save