Readd downloads mount

This commit is contained in:
Ben Sarmiento
2024-01-26 22:13:36 +01:00
parent ef3be36932
commit 17ab115747
9 changed files with 98 additions and 107 deletions

View File

@@ -23,7 +23,7 @@ func ServeRootDirectoryForInfuse(torMgr *torrent.TorrentManager) ([]byte, error)
}
buf.WriteString(dav.BaseDirectory(directory, ""))
}
if torMgr.Config.GetConfig().UseDownloadCache {
if torMgr.Config.EnableDownloadMount() {
buf.WriteString(dav.BaseDirectory(config.DOWNLOADS, ""))
}
_, size := version.GetFile()
@@ -95,7 +95,7 @@ func ServeFilesListForInfuse(directory, torrentName string, torMgr *torrent.Torr
func ServeDownloadsListForInfuse(torMgr *torrent.TorrentManager) ([]byte, error) {
var buf bytes.Buffer
if !torMgr.Config.GetConfig().UseDownloadCache {
if !torMgr.Config.EnableDownloadMount() {
buf.WriteString("Enable download cache in config to use this feature")
return buf.Bytes(), nil
}

View File

@@ -25,7 +25,7 @@ func ServeRootDirectory(torMgr *torrent.TorrentManager) ([]byte, error) {
}
buf.WriteString(dav.Directory(directory, ""))
}
if torMgr.Config.GetConfig().UseDownloadCache {
if torMgr.Config.EnableDownloadMount() {
buf.WriteString(dav.Directory(config.DOWNLOADS, ""))
}
_, size := version.GetFile()
@@ -121,7 +121,7 @@ func HandleSingleFile(directory, torrentName, fileName string, torMgr *torrent.T
func ServeDownloadsList(torMgr *torrent.TorrentManager) ([]byte, error) {
var buf bytes.Buffer
if !torMgr.Config.GetConfig().UseDownloadCache {
if !torMgr.Config.EnableDownloadMount() {
buf.WriteString("Enable download cache in config to use this feature")
return buf.Bytes(), nil
}