Immediate cleanup to prevent inconsistencies
This commit is contained in:
19
internal/torrent/dump.go
Normal file
19
internal/torrent/dump.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package torrent
|
||||
|
||||
import "github.com/debridmediamanager/zurg/internal/config"
|
||||
|
||||
func (t *TorrentManager) loadDumpedTorrents() {
|
||||
// TODO: Paywall
|
||||
count := 0
|
||||
t.getTorrentFiles("data").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)
|
||||
}
|
||||
Reference in New Issue
Block a user