assigned links

This commit is contained in:
Ben Sarmiento
2024-01-12 01:12:34 +01:00
parent cc37a92d75
commit ebab40d3e6
7 changed files with 71 additions and 57 deletions

View File

@@ -47,7 +47,7 @@ func ServeTorrentsListForInfuse(directory string, torMgr *torrent.TorrentManager
if !ok || tor.AllInProgress() {
continue
}
buf.WriteString(dav.BaseDirectory(torMgr.GetKey(tor), tor.LatestAdded))
buf.WriteString(dav.BaseDirectory(torMgr.GetKey(tor), tor.Added))
}
buf.WriteString("</d:multistatus>")
return buf.Bytes(), nil

View File

@@ -50,7 +50,7 @@ func ServeTorrentsList(directory string, torMgr *torrent.TorrentManager) ([]byte
if !ok || tor.AllInProgress() {
continue
}
buf.WriteString(dav.Directory(torMgr.GetKey(tor), tor.LatestAdded))
buf.WriteString(dav.Directory(torMgr.GetKey(tor), tor.Added))
}
buf.WriteString("</d:multistatus>")
return buf.Bytes(), nil
@@ -74,7 +74,7 @@ func ServeFilesList(directory, torrentName string, torMgr *torrent.TorrentManage
var buf bytes.Buffer
buf.WriteString("<?xml version=\"1.0\" encoding=\"utf-8\"?><d:multistatus xmlns:d=\"DAV:\">")
buf.WriteString(dav.BaseDirectory(filepath.Join(directory, torMgr.GetKey(tor)), tor.LatestAdded))
buf.WriteString(dav.BaseDirectory(filepath.Join(directory, torMgr.GetKey(tor)), tor.Added))
filenames := tor.SelectedFiles.Keys()
sort.Strings(filenames)
for _, filename := range filenames {
@@ -113,7 +113,7 @@ func HandleSingleFile(directory, torrentName, fileName string, torMgr *torrent.T
var buf bytes.Buffer
buf.WriteString("<?xml version=\"1.0\" encoding=\"utf-8\"?><d:multistatus xmlns:d=\"DAV:\">")
buf.WriteString(dav.BaseDirectory(filepath.Join(directory, torMgr.GetKey(tor)), tor.LatestAdded))
buf.WriteString(dav.BaseDirectory(filepath.Join(directory, torMgr.GetKey(tor)), tor.Added))
buf.WriteString(dav.File(fileName, file.Bytes, file.Ended))
buf.WriteString("</d:multistatus>")
return buf.Bytes(), nil