diff --git a/internal/dav/infuse.go b/internal/dav/infuse.go index 8bcad6e..ca2fcbf 100644 --- a/internal/dav/infuse.go +++ b/internal/dav/infuse.go @@ -117,7 +117,7 @@ func ServeDownloadsListForInfuse(torMgr *torrent.TorrentManager) ([]byte, error) if !ok { continue } - buf.WriteString(dav.File(download.Filename, download.Filesize, download.Generated)) + buf.WriteString(dav.File(filename, download.Filesize, download.Generated)) } buf.WriteString("") diff --git a/internal/dav/listing.go b/internal/dav/listing.go index cc0ff31..267332a 100644 --- a/internal/dav/listing.go +++ b/internal/dav/listing.go @@ -128,7 +128,7 @@ func ServeDownloadsList(torMgr *torrent.TorrentManager) ([]byte, error) { if !ok { continue } - buf.WriteString(dav.File(download.Filename, download.Filesize, download.Generated)) + buf.WriteString(dav.File(filename, download.Filesize, download.Generated)) } buf.WriteString("") return buf.Bytes(), nil diff --git a/internal/http/listing.go b/internal/http/listing.go index 9b2b79c..d5b2b08 100644 --- a/internal/http/listing.go +++ b/internal/http/listing.go @@ -97,12 +97,8 @@ func ServeDownloadsList(torMgr *torrent.TorrentManager) ([]byte, error) { filenames := torMgr.DownloadMap.Keys() sort.Strings(filenames) for _, filename := range filenames { - download, ok := torMgr.DownloadMap.Get(filename) - if !ok { - continue - } filePath := filepath.Join(config.DOWNLOADS, url.PathEscape(filename)) - buf.WriteString(fmt.Sprintf("