Fix logic on completed bin

This commit is contained in:
Ben Adrian Sarmiento
2024-06-06 12:09:54 +02:00
parent 5a6b6b1546
commit 780ee0f571

View File

@@ -159,6 +159,8 @@ func (t *TorrentManager) binOnceDone(completedTorrentId string, errorCheck bool)
if !t.OnceDoneBin.Contains(specialCase) { if !t.OnceDoneBin.Contains(specialCase) {
return false return false
} }
t.deleteInfoFile(completedTorrentId)
t.OnceDoneBin.Remove(specialCase)
t.OnceDoneBin.Clone().Each(func(entry string) bool { t.OnceDoneBin.Clone().Each(func(entry string) bool {
if strings.Contains(entry, specialCase) { if strings.Contains(entry, specialCase) {
if errorCheck { if errorCheck {
@@ -178,8 +180,6 @@ func (t *TorrentManager) binOnceDone(completedTorrentId string, errorCheck bool)
} }
return false return false
}) })
t.deleteInfoFile(completedTorrentId)
t.OnceDoneBin.Remove(specialCase)
t.persistBins() t.persistBins()
return true return true
} }