Remove download mount config, it is now always enabled

This commit is contained in:
Ben Sarmiento
2024-05-25 15:11:11 +02:00
parent 2f777f63e9
commit 264d62d0dc
8 changed files with 39 additions and 82 deletions

View File

@@ -26,9 +26,7 @@ func ServeRootDirectoryForInfuse(torMgr *torrent.TorrentManager) ([]byte, error)
buf.WriteString(dav.BaseDirectory(directory, ""))
}
if torMgr.Config.EnableDownloadMount() {
buf.WriteString(dav.BaseDirectory(config.DOWNLOADS, ""))
}
buf.WriteString(dav.BaseDirectory(config.DOWNLOADS, ""))
_, size := version.GetFile()
buf.WriteString(dav.File(version.FILE, size, ""))
@@ -108,10 +106,6 @@ func ServeFilesListForInfuse(directory, torrentName string, torMgr *torrent.Torr
func ServeDownloadsListForInfuse(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:\">")
@@ -120,7 +114,7 @@ func ServeDownloadsListForInfuse(torMgr *torrent.TorrentManager) ([]byte, error)
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))