Add setting for hiding broken torrents
This commit is contained in:
@@ -54,7 +54,7 @@ func ServeTorrentsList(directory string, torMgr *torrent.TorrentManager) ([]byte
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
func ServeFilesList(directory, torrentName string, torMgr *torrent.TorrentManager) ([]byte, error) {
|
||||
func ServeFilesList(directory, torrentName string, torMgr *torrent.TorrentManager, shouldHideBrokenTorrents bool) ([]byte, error) {
|
||||
torrents, ok := torMgr.DirectoryMap.Get(directory)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("cannot find directory %s", directory)
|
||||
@@ -80,6 +80,9 @@ func ServeFilesList(directory, torrentName string, torMgr *torrent.TorrentManage
|
||||
if file.State.Is("deleted_file") {
|
||||
continue
|
||||
}
|
||||
if file.State.Is("broken_file") && shouldHideBrokenTorrents {
|
||||
continue
|
||||
}
|
||||
if dirCfg.OnlyShowTheBiggestFile && file.Bytes < biggestFileSize {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user