Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Sorting by torrent size

Cette révision appartient à :
sfan5 2017-05-06 21:50:38 +02:00
Parent 29fe7045c7
révision 4237803422
2 fichiers modifiés avec 5 ajouts et 1 suppressions

Voir le fichier

@ -38,6 +38,7 @@
<option value="torrent_name" {{if eq .Search.Sort "torrent_name"}}selected{{end}}>Name</option>
<option value="date" {{if eq .Search.Sort "date"}}selected{{end}}>Date</option>
<option value="downloads" {{if eq .Search.Sort "downloads"}}selected{{end}}>Downloads</option>
<option value="filesize" {{if eq .Search.Sort "filesize"}}selected{{end}}>Size</option>
</select>
<select name="order" class="form-control input-sm">
<option value="desc" {{if eq .Search.Order "desc"}}selected{{end}}>Descending</option>

Voir le fichier

@ -7,7 +7,10 @@ import (
func FormatFilesize(bytes int64) string {
var unit string
var value float64
if bytes > 1024*1024*1024 {
if bytes > 1024*1024*1024*1024 {
unit = "TiB"
value = float64(bytes) / (1024*1024*1024*1024)
} else if bytes > 1024*1024*1024 {
unit = "GiB"
value = float64(bytes) / (1024*1024*1024)
} else if bytes > 1024*1024 {