Do not unrestrict files that are marked as broken until it is fixed
This commit is contained in:
@@ -267,7 +267,7 @@ func (t *TorrentManager) assignUnassignedLinks(torrent *Torrent) bool {
|
||||
newUnassignedLinks := cmap.New[*realdebrid.Download]()
|
||||
torrent.UnassignedLinks.Each(func(link string) bool {
|
||||
// unrestrict each unassigned link that was filled out during torrent init
|
||||
unrestrict := t.UnrestrictUntilOk(link)
|
||||
unrestrict := t.UnrestrictLinkUntilOk(link)
|
||||
if unrestrict == nil {
|
||||
newUnassignedLinks.Set(link, nil)
|
||||
// return early, no point continuing
|
||||
@@ -532,7 +532,7 @@ func (t *TorrentManager) isStillBroken(info *realdebrid.TorrentInfo, brokenFiles
|
||||
for _, oldFile := range brokenFiles {
|
||||
for idx, newFile := range selectedFiles {
|
||||
if oldFile.Bytes == newFile.Bytes {
|
||||
unrestrict := t.UnrestrictUntilOk(selectedFiles[idx].Link)
|
||||
unrestrict := t.UnrestrictFileUntilOk(selectedFiles[idx])
|
||||
if unrestrict == nil || oldFile.Bytes != unrestrict.Filesize {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user