Support filtering by size

This commit is contained in:
Ben Sarmiento
2024-01-06 23:53:47 +01:00
parent 4b441ce2d8
commit 5d733b8be4
5 changed files with 26 additions and 5 deletions

View File

@@ -80,6 +80,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
}
buf.WriteString(dav.File(filename, file.Bytes, file.Ended))
}
buf.WriteString("</d:multistatus>")