Fix repairs

This commit is contained in:
Ben Sarmiento
2024-01-16 21:40:07 +01:00
parent 727c694c02
commit 5049320379
3 changed files with 9 additions and 22 deletions

View File

@@ -29,7 +29,7 @@ type TorrentManager struct {
DownloadMap cmap.ConcurrentMap[string, *realdebrid.Download]
Repairs cmap.ConcurrentMap[string, bool]
allAccessKeys mapset.Set[string]
forRepairs mapset.Set[string]
onlyForRepair mapset.Set[string]
latestState *LibraryState
requiredVersion string
workerPool *ants.Pool
@@ -44,7 +44,7 @@ func NewTorrentManager(cfg config.ConfigInterface, api *realdebrid.RealDebrid, p
Config: cfg,
Api: api,
allAccessKeys: mapset.NewSet[string](),
forRepairs: mapset.NewSet[string](),
onlyForRepair: mapset.NewSet[string](),
latestState: &LibraryState{},
requiredVersion: "11.01.2024",
workerPool: p,
@@ -63,6 +63,7 @@ func NewTorrentManager(cfg config.ConfigInterface, api *realdebrid.RealDebrid, p
// Fetch downloads
t.DownloadCache = cmap.New[*realdebrid.Download]()
t.DownloadMap = cmap.New[*realdebrid.Download]()
t.Repairs = cmap.New[bool]()
if t.Config.EnableDownloadCache() {
_ = t.workerPool.Submit(func() {
page := 1