minor
This commit is contained in:
@@ -483,7 +483,10 @@ func (c *Cache) ProcessTorrent(t *types.Torrent, refreshRclone bool) error {
|
||||
for _, file := range t.Files {
|
||||
if file.Link == "" {
|
||||
c.logger.Debug().Msgf("Torrent %s is not complete, missing link for file %s. Triggering a reinsert", t.Id, file.Name)
|
||||
c.reinsertTorrent(t)
|
||||
if err := c.ReInsertTorrent(t); err != nil {
|
||||
c.logger.Error().Err(err).Msgf("Failed to reinsert torrent %s", t.Id)
|
||||
return fmt.Errorf("failed to reinsert torrent: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ func (c *Cache) submitForRepair(repairType RepairType, torrentId, fileName strin
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Cache) reinsertTorrent(torrent *types.Torrent) error {
|
||||
func (c *Cache) ReInsertTorrent(torrent *types.Torrent) error {
|
||||
// Check if Magnet is not empty, if empty, reconstruct the magnet
|
||||
if _, ok := c.repairsInProgress.Load(torrent.Id); ok {
|
||||
return fmt.Errorf("repair already in progress for torrent %s", torrent.Id)
|
||||
|
||||
Reference in New Issue
Block a user