summaryrefslogtreecommitdiff
path: root/searx/templates/simple/result_templates/torrent.html
diff options
context:
space:
mode:
authorBnyro <bnyro@tutanota.com>2024-06-12 22:35:13 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-06-15 15:42:29 +0200
commite9f8412a6e4b399a3335da73b3d321104bb0c4fb (patch)
tree0caf5c1bede7bb8739c5c2e5d107fa75455ecc24 /searx/templates/simple/result_templates/torrent.html
parent16ce5612dd0ef426b6851ab97b248595f3933d8f (diff)
[perf] torrents.html, files.html: don't parse and re-format filesize
Diffstat (limited to 'searx/templates/simple/result_templates/torrent.html')
-rw-r--r--searx/templates/simple/result_templates/torrent.html9
1 files changed, 1 insertions, 8 deletions
diff --git a/searx/templates/simple/result_templates/torrent.html b/searx/templates/simple/result_templates/torrent.html
index 46cde2a65..befad2c89 100644
--- a/searx/templates/simple/result_templates/torrent.html
+++ b/searx/templates/simple/result_templates/torrent.html
@@ -8,14 +8,7 @@
{% if result.seed is defined %}<p class="stat"> &bull; {{ icon_big('arrow-swap') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> &bull; {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span></p>{% endif %}
-{%- if result.filesize %}<p class="stat">{{ icon_big('floppy-disk') }} {{ _('Filesize') }}<span class="badge">
- {%- if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') }}
- {%- elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} {{ _('kiB') }}
- {%- elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} {{ _('MiB') }}
- {%- elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} {{ _('GiB') }}
- {%- else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif -%}
- </span></p>
-{%- endif -%}
+{%- if result.filesize %}<p class="stat">{{ icon_big('floppy-disk') }} {{ _('Filesize') }}<span class="badge">{{ result.filesize }}</span></p>{%- endif -%}
{%- if result.files %}<p class="stat">{{ icon_big('file') }} {{ _('Number of Files') }} <span class="badge">{{ result.files }}</span></p>{% endif -%}