Clean up grouping logic

This commit is contained in:
Ben Sarmiento
2023-10-18 21:47:57 +02:00
parent 0fa7b407b0
commit ce0b2445b2
4 changed files with 14 additions and 21 deletions

View File

@@ -23,9 +23,9 @@ func findAllTorrentsWithName(t *torrent.TorrentManager, directory, torrentName s
var matchingTorrents []torrent.Torrent
torrents := t.GetByDirectory(directory)
for _, torrent := range torrents {
if torrent.Name == torrentName || strings.HasPrefix(torrent.Name, torrentName) {
matchingTorrents = append(matchingTorrents, torrent)
for i := range torrents {
if torrents[i].Name == torrentName || strings.HasPrefix(torrents[i].Name, torrentName) {
matchingTorrents = append(matchingTorrents, torrents[i])
}
}