refactor
This commit is contained in:
@@ -2,10 +2,7 @@ package dav
|
||||
|
||||
import (
|
||||
"log"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/debridmediamanager.com/zurg/internal/torrent"
|
||||
)
|
||||
|
||||
// convertRFC3339toRFC1123 converts a date from RFC3339 to RFC1123
|
||||
@@ -17,15 +14,3 @@ func convertRFC3339toRFC1123(input string) string {
|
||||
}
|
||||
return t.Format("Mon, 02 Jan 2006 15:04:05 GMT")
|
||||
}
|
||||
|
||||
// findAllTorrentsWithName finds all torrents in a given directory with a given name
|
||||
func findAllTorrentsWithName(t *torrent.TorrentManager, directory, torrentName string) []torrent.Torrent {
|
||||
matchingTorrents := make([]torrent.Torrent, 0, 10)
|
||||
torrents := t.GetByDirectory(directory)
|
||||
for i := range torrents {
|
||||
if torrents[i].Name == torrentName || strings.HasPrefix(torrents[i].Name, torrentName) {
|
||||
matchingTorrents = append(matchingTorrents, torrents[i])
|
||||
}
|
||||
}
|
||||
return matchingTorrents
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user