Files
zurg/internal/torrent/dump.go
2024-06-05 09:31:50 +02:00

20 lines
501 B
Go

package torrent
import "github.com/debridmediamanager/zurg/internal/config"
func (t *TorrentManager) loadDumpedTorrents() {
// TODO: Paywall?
count := 0
t.getTorrentFiles("dump").Each(func(filePath string) bool {
torrent := t.readTorrentFromFile(filePath)
if torrent != nil {
accessKey := t.GetKey(torrent)
torrents, _ := t.DirectoryMap.Get(config.DUMPED_TORRENTS)
torrents.Set(accessKey, torrent)
count++
}
return false
})
t.log.Infof("Loaded %d dumped torrents", count)
}