Update returned error codes

This commit is contained in:
Ben Adrian Sarmiento
2024-06-26 16:28:19 +02:00
parent d5e3665a53
commit f4910b8e87
5 changed files with 19 additions and 13 deletions

View File

@@ -10,11 +10,13 @@ import (
"github.com/debridmediamanager/zurg/internal/config"
zurghttp "github.com/debridmediamanager/zurg/pkg/http"
"github.com/debridmediamanager/zurg/pkg/logutil"
cmap "github.com/orcaman/concurrent-map/v2"
"github.com/panjf2000/ants/v2"
)
type RealDebrid struct {
torrentsCache []Torrent
UnrestrictMap cmap.ConcurrentMap[string, cmap.ConcurrentMap[string, *Download]]
apiClient *zurghttp.HTTPClient
unrestrictClient *zurghttp.HTTPClient
downloadClient *zurghttp.HTTPClient
@@ -33,7 +35,7 @@ func NewRealDebrid(apiClient, unrestrictClient, downloadClient *zurghttp.HTTPCli
cfg: cfg,
log: log,
}
rd.readCachedTorrents()
rd.loadCachedTorrents()
return rd
}

View File

@@ -211,7 +211,7 @@ func (rd *RealDebrid) cacheTorrents(torrents []Torrent) {
rd.torrentsCache = torrents
}
func (rd *RealDebrid) readCachedTorrents() {
func (rd *RealDebrid) loadCachedTorrents() {
filePath := "data/info/all.json"
file, err := os.Open(filePath)
if err != nil {