Fix logic of fetching torrents
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
func (t *TorrentManager) refreshTorrents(isInitialRun bool) []string {
|
||||
instances, _, err := t.Api.GetTorrents(false)
|
||||
instances, _, err := t.api.GetTorrents(false)
|
||||
if err != nil {
|
||||
t.log.Warnf("Cannot get torrents: %v", err)
|
||||
return nil
|
||||
@@ -72,6 +72,7 @@ func (t *TorrentManager) refreshTorrents(isInitialRun bool) []string {
|
||||
t.assignedDirectoryCb(mainTor, func(directory string) {
|
||||
listing, _ := t.DirectoryMap.Get(directory)
|
||||
listing.Set(accessKey, mainTor)
|
||||
|
||||
updatedPaths = append(updatedPaths, fmt.Sprintf("%s/%s", directory, accessKey))
|
||||
// this is just for the logs
|
||||
if directory != config.ALL_TORRENTS {
|
||||
@@ -151,7 +152,7 @@ func (t *TorrentManager) getMoreInfo(rdTorrent realdebrid.Torrent) *Torrent {
|
||||
return diskTor
|
||||
}
|
||||
|
||||
info, err := t.Api.GetTorrentInfo(rdTorrent.ID)
|
||||
info, err := t.api.GetTorrentInfo(rdTorrent.ID)
|
||||
if err != nil {
|
||||
t.log.Warnf("Cannot get info for id=%s: %v", rdTorrent.ID, err)
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user