Add lock for repairs

This commit is contained in:
Ben Sarmiento
2024-01-16 02:05:41 +01:00
parent bb5bad1576
commit 2cb29284f6
3 changed files with 19 additions and 2 deletions

View File

@@ -168,6 +168,7 @@ func (t *TorrentManager) getMoreInfo(rdTorrent realdebrid.Torrent) *Torrent {
OriginalName: info.OriginalName,
Added: info.Added,
Hash: info.Hash,
Lock: &sync.Mutex{},
}
// SelectedFiles is a subset of Files with only the selected ones
// it also has a Link field, which can be empty
@@ -233,6 +234,7 @@ func (t *TorrentManager) mergeToMain(existing, toMerge *Torrent) Torrent {
Unfixable: existing.Unfixable || toMerge.Unfixable,
UnassignedLinks: existing.UnassignedLinks.Union(toMerge.UnassignedLinks),
BrokenLinks: existing.BrokenLinks.Union(toMerge.BrokenLinks),
Lock: &sync.Mutex{},
}
// this function triggers only when we have a new DownloadedID