Biggest file filter
This commit is contained in:
@@ -115,6 +115,16 @@ func (t *Torrent) ComputeTotalSize() int64 {
|
||||
return totalSize
|
||||
}
|
||||
|
||||
func (t *Torrent) ComputeBiggestFileSize() int64 {
|
||||
biggestSize := int64(0)
|
||||
t.SelectedFiles.IterCb(func(key string, value *File) {
|
||||
if value.Bytes > biggestSize {
|
||||
biggestSize = value.Bytes
|
||||
}
|
||||
})
|
||||
return biggestSize
|
||||
}
|
||||
|
||||
func (t *Torrent) OlderThanDuration(duration time.Duration) bool {
|
||||
latestAdded, err := time.Parse(time.RFC3339, t.LatestAdded)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user