Trigger repair on initial run

This commit is contained in:
Ben Sarmiento
2024-02-17 04:40:13 +01:00
parent 041e02816b
commit 122ab19b7b
2 changed files with 3 additions and 0 deletions

View File

@@ -68,6 +68,7 @@ func NewTorrentManager(cfg config.ConfigInterface, api *realdebrid.RealDebrid, w
t.setNewLatestState(t.getCurrentState()) t.setNewLatestState(t.getCurrentState())
t.StartRefreshJob() t.StartRefreshJob()
t.StartRepairJob() t.StartRepairJob()
t.TriggerRepair(nil)
}) })
t.workerPool.Submit(func() { t.workerPool.Submit(func() {
t.mountDownloads() t.mountDownloads()

View File

@@ -141,9 +141,11 @@ func (t *TorrentManager) getMoreInfo(rdTorrent realdebrid.Torrent) *Torrent {
if torrentFromCache, exists := infoCache.Get(rdTorrent.ID); exists && if torrentFromCache, exists := infoCache.Get(rdTorrent.ID); exists &&
!torrentFromCache.AnyInProgress() && !torrentFromCache.AnyInProgress() &&
torrentFromCache.SelectedFiles.Count() == len(rdTorrent.Links) { torrentFromCache.SelectedFiles.Count() == len(rdTorrent.Links) {
return torrentFromCache return torrentFromCache
} else if !exists { } else if !exists {
torrentFromFile := t.readTorrentFromFile(rdTorrent.ID) torrentFromFile := t.readTorrentFromFile(rdTorrent.ID)
if torrentFromFile != nil && if torrentFromFile != nil &&