Add downloads dir to http, not sure if working

This commit is contained in:
Ben Sarmiento
2024-01-07 23:09:02 +01:00
parent 798ff0ddb7
commit 57e6b0b860
5 changed files with 37 additions and 16 deletions

View File

@@ -9,7 +9,6 @@ import (
"github.com/debridmediamanager/zurg/internal/config"
"github.com/debridmediamanager/zurg/internal/torrent"
"github.com/debridmediamanager/zurg/pkg/dav"
"github.com/debridmediamanager/zurg/pkg/logutil"
)
func ServeRootDirectoryForInfuse(torMgr *torrent.TorrentManager) ([]byte, error) {
@@ -27,7 +26,7 @@ func ServeRootDirectoryForInfuse(torMgr *torrent.TorrentManager) ([]byte, error)
return buf.Bytes(), nil
}
func ServeTorrentsListForInfuse(directory string, torMgr *torrent.TorrentManager, log *logutil.Logger) ([]byte, error) {
func ServeTorrentsListForInfuse(directory string, torMgr *torrent.TorrentManager) ([]byte, error) {
torrents, ok := torMgr.DirectoryMap.Get(directory)
if !ok {
return nil, fmt.Errorf("cannot find directory %s", directory)
@@ -48,7 +47,7 @@ func ServeTorrentsListForInfuse(directory string, torMgr *torrent.TorrentManager
return buf.Bytes(), nil
}
func ServeFilesListForInfuse(directory, torrentName string, torMgr *torrent.TorrentManager, log *logutil.Logger) ([]byte, error) {
func ServeFilesListForInfuse(directory, torrentName string, torMgr *torrent.TorrentManager) ([]byte, error) {
torrents, ok := torMgr.DirectoryMap.Get(directory)
if !ok {
return nil, fmt.Errorf("cannot find directory %s", directory)

View File

@@ -10,7 +10,6 @@ import (
"github.com/debridmediamanager/zurg/internal/config"
"github.com/debridmediamanager/zurg/internal/torrent"
"github.com/debridmediamanager/zurg/pkg/dav"
"github.com/debridmediamanager/zurg/pkg/logutil"
)
func ServeRootDirectory(torMgr *torrent.TorrentManager) ([]byte, error) {
@@ -29,7 +28,7 @@ func ServeRootDirectory(torMgr *torrent.TorrentManager) ([]byte, error) {
return buf.Bytes(), nil
}
func ServeTorrentsList(directory string, torMgr *torrent.TorrentManager, log *logutil.Logger) ([]byte, error) {
func ServeTorrentsList(directory string, torMgr *torrent.TorrentManager) ([]byte, error) {
torrents, ok := torMgr.DirectoryMap.Get(directory)
if !ok {
return nil, fmt.Errorf("cannot find directory %s", directory)
@@ -51,7 +50,7 @@ func ServeTorrentsList(directory string, torMgr *torrent.TorrentManager, log *lo
return buf.Bytes(), nil
}
func ServeFilesList(directory, torrentName string, torMgr *torrent.TorrentManager, log *logutil.Logger) ([]byte, error) {
func ServeFilesList(directory, torrentName string, torMgr *torrent.TorrentManager) ([]byte, error) {
torrents, ok := torMgr.DirectoryMap.Get(directory)
if !ok {
return nil, fmt.Errorf("cannot find directory %s", directory)
@@ -92,7 +91,7 @@ func ServeFilesList(directory, torrentName string, torMgr *torrent.TorrentManage
return buf.Bytes(), nil
}
func HandleSingleFile(directory, torrentName, fileName string, torMgr *torrent.TorrentManager, log *logutil.Logger) ([]byte, error) {
func HandleSingleFile(directory, torrentName, fileName string, torMgr *torrent.TorrentManager) ([]byte, error) {
torrents, ok := torMgr.DirectoryMap.Get(directory)
if !ok {
return nil, fmt.Errorf("cannot find directory %s", directory)