Refactor torrent manager

This commit is contained in:
Ben Sarmiento
2023-11-09 02:34:04 +01:00
parent 9dfd6c32d5
commit 15a0ba95d8
14 changed files with 436 additions and 516 deletions

View File

@@ -15,7 +15,7 @@ func createMultiTorrentResponse(basePath string, torrents []torrent.Torrent) (*d
seen := make(map[string]bool)
for _, item := range torrents {
if item.Progress != 100 {
if item.InProgress {
continue
}
if _, exists := seen[item.AccessKey]; exists {
@@ -64,7 +64,7 @@ func createSingleTorrentResponse(basePath string, torrents []torrent.Torrent) (*
torrentResponses = append(torrentResponses, dav.File(
filePath,
file.Bytes,
convertRFC3339toRFC1123(torrent.Added),
convertRFC3339toRFC1123(torrent.LatestAdded),
file.Link,
))
}