Rename variables for easy reference

This commit is contained in:
Ben Adrian Sarmiento
2024-07-21 02:11:32 +02:00
parent 47751320f7
commit f8b9f8955b
8 changed files with 46 additions and 33 deletions

View File

@@ -105,12 +105,12 @@ func NewTorrentManager(cfg config.ConfigInterface, api *realdebrid.RealDebrid, w
defer wg.Done()
// initial load of existing *.zurgtorrent files
allTorrents, _ := t.DirectoryMap.Get(INT_ALL)
torrents, _ := t.DirectoryMap.Get(INT_ALL)
t.getTorrentFiles("data").Each(func(filePath string) bool {
torrent := t.readTorrentFromFile(filePath)
if torrent != nil {
accessKey := t.GetKey(torrent)
allTorrents.Set(accessKey, torrent)
torrents.Set(accessKey, torrent)
t.assignDirectory(torrent, false, false)
}
return false
@@ -498,12 +498,12 @@ func (t *TorrentManager) StartDumpJob() {
}
func (t *TorrentManager) analyzeAllTorrents() {
allTorrents, _ := t.DirectoryMap.Get(INT_ALL)
totalCount := allTorrents.Count()
torrents, _ := t.DirectoryMap.Get(INT_ALL)
totalCount := torrents.Count()
t.log.Infof("Applying media info details to all %d torrents", totalCount)
idx := 0
skipTheRest := false
allTorrents.IterCb(func(_ string, torrent *Torrent) {
torrents.IterCb(func(_ string, torrent *Torrent) {
if skipTheRest {
return
}