This commit is contained in:
Ben Sarmiento
2023-10-20 01:27:30 +02:00
parent 987542f89b
commit 1117e777ff
6 changed files with 12 additions and 59 deletions

View File

@@ -67,7 +67,7 @@ func createSingleTorrentResponse(basePath string, torrents []torrent.Torrent, t
torrentResponses = append(torrentResponses, dav.File(
filePath,
file.Bytes,
convertDate(torrent.Added),
convertRFC3339toRFC1123(torrent.Added),
file.Link,
))
}

View File

@@ -8,8 +8,8 @@ import (
"github.com/debridmediamanager.com/zurg/internal/torrent"
)
// convertDate converts a date from RFC3339 to RFC1123
func convertDate(input string) string {
// convertRFC3339toRFC1123 converts a date from RFC3339 to RFC1123
func convertRFC3339toRFC1123(input string) string {
t, err := time.Parse(time.RFC3339, input)
if err != nil {
log.Println("Error:", err)