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

@@ -17,7 +17,7 @@ func ServeRootDirectory(torMgr *torrent.TorrentManager) ([]byte, error) {
var buf bytes.Buffer
buf.WriteString("<ol>")
directories := torMgr.DirectoryMap.Keys()
if torMgr.Config.GetConfig().UseDownloadCache {
if torMgr.Config.EnableDownloadMount() {
directories = append(directories, config.DOWNLOADS)
}
sort.Strings(directories)
@@ -95,7 +95,7 @@ func ServeFilesList(directory, torrentName string, torMgr *torrent.TorrentManage
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
}