Remove download mount config, it is now always enabled
This commit is contained in:
@@ -25,9 +25,7 @@ func ServeRootDirectory(torMgr *torrent.TorrentManager) ([]byte, error) {
|
||||
}
|
||||
buf.WriteString(dav.Directory(directory, ""))
|
||||
}
|
||||
if torMgr.Config.EnableDownloadMount() {
|
||||
buf.WriteString(dav.Directory(config.DOWNLOADS, ""))
|
||||
}
|
||||
buf.WriteString(dav.Directory(config.DOWNLOADS, ""))
|
||||
_, size := version.GetFile()
|
||||
buf.WriteString(dav.File(version.FILE, size, ""))
|
||||
buf.WriteString("</d:multistatus>")
|
||||
@@ -121,17 +119,13 @@ func HandleSingleFile(directory, torrentName, fileName string, torMgr *torrent.T
|
||||
|
||||
func ServeDownloadsList(torMgr *torrent.TorrentManager) ([]byte, error) {
|
||||
var buf bytes.Buffer
|
||||
if !torMgr.Config.EnableDownloadMount() {
|
||||
buf.WriteString("Enable download mount in config to use this feature")
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
buf.WriteString("<?xml version=\"1.0\" encoding=\"utf-8\"?><d:multistatus xmlns:d=\"DAV:\">")
|
||||
buf.WriteString(dav.BaseDirectory(config.DOWNLOADS, ""))
|
||||
filenames := torMgr.DownloadMap.Keys()
|
||||
sort.Strings(filenames)
|
||||
for _, filename := range filenames {
|
||||
download, ok := torMgr.DownloadMap.Get(filename)
|
||||
if !ok {
|
||||
if !ok || strings.HasPrefix(download.Link, "https://real-debrid.com/d/") {
|
||||
continue
|
||||
}
|
||||
buf.WriteString(dav.File(download.Filename, download.Filesize, download.Generated))
|
||||
|
||||
Reference in New Issue
Block a user