Reimplement deletes and marking files as broken
This commit is contained in:
@@ -78,8 +78,8 @@ func ServeFilesList(directory, torrentName string, torMgr *torrent.TorrentManage
|
||||
filenames := tor.SelectedFiles.Keys()
|
||||
sort.Strings(filenames)
|
||||
for _, filename := range filenames {
|
||||
file, ok := tor.SelectedFiles.Get(filename)
|
||||
if !ok || !strings.HasPrefix(file.Link, "http") {
|
||||
file, _ := tor.SelectedFiles.Get(filename)
|
||||
if file.IsDeleted {
|
||||
continue
|
||||
}
|
||||
if dirCfg.OnlyShowTheBiggestFile && file.Bytes < biggestFileSize {
|
||||
@@ -107,7 +107,7 @@ func HandleSingleFile(directory, torrentName, fileName string, torMgr *torrent.T
|
||||
return nil, fmt.Errorf("cannot find torrent %s", torrentName)
|
||||
}
|
||||
file, ok := tor.SelectedFiles.Get(fileName)
|
||||
if !ok || !strings.HasPrefix(file.Link, "http") {
|
||||
if !ok || file.IsDeleted {
|
||||
return nil, fmt.Errorf("cannot find file %s", fileName)
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ func ServeDownloadsList(torMgr *torrent.TorrentManager) ([]byte, error) {
|
||||
sort.Strings(filenames)
|
||||
for _, filename := range filenames {
|
||||
download, ok := torMgr.DownloadMap.Get(filename)
|
||||
if !ok || !strings.HasPrefix(download.Link, "http") {
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
buf.WriteString(dav.File(download.Filename, download.Filesize, download.Generated))
|
||||
|
||||
Reference in New Issue
Block a user