Fix http mount issues
This commit is contained in:
@@ -100,7 +100,13 @@ func ServeDownloadsListForInfuse(torMgr *torrent.TorrentManager) ([]byte, error)
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
buf.WriteString("<?xml version=\"1.0\" encoding=\"utf-8\"?><d:multistatus xmlns:d=\"DAV:\">")
|
||||
for _, download := range torMgr.DownloadCache.Items() {
|
||||
filenames := torMgr.DownloadMap.Keys()
|
||||
sort.Strings(filenames)
|
||||
for _, filename := range filenames {
|
||||
download, ok := torMgr.DownloadMap.Get(filename)
|
||||
if !ok || !strings.HasPrefix(download.Link, "http") {
|
||||
continue
|
||||
}
|
||||
buf.WriteString(dav.File(download.Filename, download.Filesize, download.Generated))
|
||||
}
|
||||
buf.WriteString("</d:multistatus>")
|
||||
|
||||
@@ -127,7 +127,13 @@ func ServeDownloadsList(torMgr *torrent.TorrentManager) ([]byte, error) {
|
||||
}
|
||||
buf.WriteString("<?xml version=\"1.0\" encoding=\"utf-8\"?><d:multistatus xmlns:d=\"DAV:\">")
|
||||
buf.WriteString(dav.BaseDirectory(config.DOWNLOADS, ""))
|
||||
for _, download := range torMgr.DownloadCache.Items() {
|
||||
filenames := torMgr.DownloadMap.Keys()
|
||||
sort.Strings(filenames)
|
||||
for _, filename := range filenames {
|
||||
download, ok := torMgr.DownloadMap.Get(filename)
|
||||
if !ok || !strings.HasPrefix(download.Link, "http") {
|
||||
continue
|
||||
}
|
||||
buf.WriteString(dav.File(download.Filename, download.Filesize, download.Generated))
|
||||
}
|
||||
buf.WriteString("</d:multistatus>")
|
||||
|
||||
Reference in New Issue
Block a user