mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
[perf] torrents.html, files.html: don't parse and re-format filesize
This commit is contained in:
parent
16ce5612dd
commit
e9f8412a6e
13 changed files with 23 additions and 86 deletions
|
|
@ -35,14 +35,7 @@
|
|||
|
||||
{%- if result.filename %}<tr><td>{{ _('Filename') }}</td><td>{{ result.filename|safe }}</td></tr>{% endif -%}
|
||||
|
||||
{%- if result.size %}<tr><td>{{ _('Filesize') }}</td><td>
|
||||
{%- if result.size < 1024 %}{{ result.size }} {{ _('Bytes') -}}
|
||||
{%- elif result.size < 1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024) }} {{ _('kiB') -}}
|
||||
{%- elif result.size < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024/1024) }} {{ _('MiB') -}}
|
||||
{%- elif result.size < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024/1024/1024) }} {{ _('GiB') -}}
|
||||
{%- else %}{{ '{0:0.2f}'.format(result.size/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif -%}
|
||||
</td></tr>
|
||||
{%- endif -%}
|
||||
{%- if result.size %}<tr><td>{{ _('Filesize') }}</td><td>{{ result.size|safe }}</td></tr>{%- endif -%}
|
||||
|
||||
{%- if result.time %}<tr><td>{{ _('Date') }}</td><td>{{ result.time|safe }}</td></tr>{% endif -%}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue