révision
866ca24ac2
2 fichiers modifiés avec 5 ajouts et 1 suppressions
|
@ -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>
|
||||
|
|
|
@ -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 {
|
||||
|
|
Référencer dans un nouveau ticket