Make sure torrents get deleted on failed

This commit is contained in:
Mukhtar Akere
2024-12-12 17:38:53 +01:00
parent 4eb3539347
commit 7359f280b0
3 changed files with 9 additions and 0 deletions

View File

@@ -163,6 +163,9 @@ func ProcessTorrent(d *DebridService, magnet *common.Magnet, a *arr.Arr, isSymli
dbt, err := db.SubmitMagnet(debridTorrent)
if err != nil || dbt.Id == "" {
if dbt != nil {
dbt.Delete()
}
logger.Printf("Error submitting magnet: %s", err)
continue
}