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

@@ -17,9 +17,7 @@ func ServeRootDirectory(torMgr *torrent.TorrentManager) ([]byte, error) {
var buf bytes.Buffer
buf.WriteString("<ol>")
directories := torMgr.DirectoryMap.Keys()
if torMgr.Config.EnableDownloadMount() {
directories = append(directories, config.DOWNLOADS)
}
directories = append(directories, config.DOWNLOADS)
sort.Strings(directories)
for _, directory := range directories {
if strings.HasPrefix(directory, "int__") {
@@ -95,16 +93,12 @@ func ServeFilesList(directory, torrentName string, torMgr *torrent.TorrentManage
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("<ol>")
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
}
filePath := filepath.Join(config.DOWNLOADS, url.PathEscape(filename))