Create a torrentMap

This commit is contained in:
Ben Sarmiento
2023-11-08 20:20:52 +01:00
parent 17cd7ae1f4
commit 9dfd6c32d5
16 changed files with 405 additions and 324 deletions

View File

@@ -18,12 +18,12 @@ func createMultiTorrentResponse(basePath string, torrents []torrent.Torrent) (*d
if item.Progress != 100 {
continue
}
if _, exists := seen[item.Name]; exists {
if _, exists := seen[item.AccessKey]; exists {
continue
}
seen[item.Name] = true
seen[item.AccessKey] = true
path := filepath.Join(basePath, item.Name)
path := filepath.Join(basePath, item.AccessKey)
responses = append(responses, dav.Directory(path))
}
@@ -39,7 +39,7 @@ func createSingleTorrentResponse(basePath string, torrents []torrent.Torrent) (*
var responses []dav.Response
// initial response is the directory itself
currentPath := filepath.Join(basePath, torrents[0].Name)
currentPath := filepath.Join(basePath, torrents[0].AccessKey)
responses = append(responses, dav.Directory(currentPath))
finalName := make(map[string]bool)