- Fix nil checks
- Enable add arr to config page - Other minor fixes
This commit is contained in:
@@ -621,13 +621,12 @@ func (c *Cache) GetClient() types.Client {
|
||||
}
|
||||
|
||||
func (c *Cache) DeleteTorrent(id string) error {
|
||||
c.logger.Info().Msgf("Deleting torrent %s from cache", id)
|
||||
c.torrentsRefreshMu.Lock()
|
||||
defer c.torrentsRefreshMu.Unlock()
|
||||
|
||||
if c.deleteTorrent(id, true) {
|
||||
c.RefreshListings(true)
|
||||
c.logger.Info().Msgf("Torrent %s deleted successfully", id)
|
||||
c.logger.Trace().Msgf("Torrent %s deleted successfully", id)
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -55,12 +55,16 @@ func (c *Cache) IsTorrentBroken(t *CachedTorrent, filenames []string) bool {
|
||||
// Check if file is missing
|
||||
if f.Link == "" {
|
||||
// refresh torrent and then break
|
||||
t = c.refreshTorrent(t)
|
||||
break
|
||||
if newT := c.refreshTorrent(t); newT != nil {
|
||||
t = newT
|
||||
} else {
|
||||
c.logger.Error().Str("torrentId", t.Torrent.Id).Msg("Failed to refresh torrent")
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if t == nil || t.Torrent == nil {
|
||||
if t.Torrent == nil {
|
||||
c.logger.Error().Str("torrentId", t.Torrent.Id).Msg("Failed to refresh torrent")
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user