Support filtering by size
This commit is contained in:
@@ -77,6 +77,12 @@ func ServeFilesList(directory, torrentName string, torMgr *torrent.TorrentManage
|
||||
if dirCfg.OnlyShowTheBiggestFile && file.Bytes < biggestFileSize {
|
||||
continue
|
||||
}
|
||||
if dirCfg.OnlyShowFilesWithSizeLte > 0 && file.Bytes > dirCfg.OnlyShowFilesWithSizeLte {
|
||||
continue
|
||||
}
|
||||
if dirCfg.OnlyShowFilesWithSizeGte > 0 && file.Bytes < dirCfg.OnlyShowFilesWithSizeGte {
|
||||
continue
|
||||
}
|
||||
filePath := filepath.Join(directory, torrentName, url.PathEscape(filename))
|
||||
buf.WriteString(fmt.Sprintf("<li><a href=\"/http/%s\">%s</a></li>", filePath, filename))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user