Optimizations

This commit is contained in:
Ben Sarmiento
2023-11-18 18:11:28 +01:00
parent c520b5572f
commit 44ec4a0b00
3 changed files with 10 additions and 20 deletions

View File

@@ -112,6 +112,9 @@ func handleSingleTorrent(requestPath string, t *torrent.TorrentManager) ([]byte,
sort.Strings(filenames)
for _, filename := range filenames {
file, _ := tor.SelectedFiles.Get(filename)
if file == nil || file.Link == "" {
continue
}
responses = append(responses, dav.File(
filepath.Join(requestPath, filename),
file.Bytes,