Random Fixes:

- Fix uncached error
- Fix naming and race conditions
This commit is contained in:
Mukhtar Akere
2024-09-14 01:42:52 +01:00
parent 9511f3e99e
commit f622cbfe63
12 changed files with 108 additions and 75 deletions

View File

@@ -17,11 +17,14 @@ func (q *QBit) Process(magnet *common.Magnet, category string) (*Torrent, error)
debridTorrent, err := debrid.ProcessQBitTorrent(q.debrid, magnet, category)
if err != nil || debridTorrent == nil {
// Mark as failed
q.logger.Printf("Failed to process torrent: %s: %v", magnet.Name, err)
q.MarkAsFailed(torrent)
return torrent, err
}
torrent.ID = debridTorrent.Id
q.processFiles(torrent, debridTorrent)
torrent.Name = debridTorrent.Name // Update the name before adding it to *arrs storage
torrent.DebridTorrent = debridTorrent
go q.processFiles(torrent, debridTorrent)
return torrent, nil
}