hotfix: bad torrent

This commit is contained in:
Mukhtar Akere
2025-05-13 13:37:35 +01:00
parent e5b3e0741e
commit 3b018b3571
2 changed files with 7 additions and 3 deletions

View File

@@ -136,7 +136,7 @@ func (c *Cache) GenerateDownloadLinks(t CachedTorrent) {
} }
} }
c.SaveTorrent(t) c.setTorrent(t, nil)
} }
func (c *Cache) updateDownloadLink(dl *types.DownloadLink) { func (c *Cache) updateDownloadLink(dl *types.DownloadLink) {

View File

@@ -39,7 +39,9 @@ func (c *Cache) markAsFailedToReinsert(torrentId string) {
// Remove the torrent from the directory if it has failed to reinsert, max retries are hardcoded to 5 // Remove the torrent from the directory if it has failed to reinsert, max retries are hardcoded to 5
if torrent, ok := c.torrents.getByID(torrentId); ok { if torrent, ok := c.torrents.getByID(torrentId); ok {
torrent.Bad = true torrent.Bad = true
c.SaveTorrent(torrent) c.setTorrent(torrent, func(torrent CachedTorrent) {
c.listingDebouncer.Call(false)
})
} }
} }
@@ -50,7 +52,9 @@ func (c *Cache) markAsSuccessfullyReinserted(torrentId string) {
c.failedToReinsert.Delete(torrentId) c.failedToReinsert.Delete(torrentId)
if torrent, ok := c.torrents.getByID(torrentId); ok { if torrent, ok := c.torrents.getByID(torrentId); ok {
torrent.Bad = false torrent.Bad = false
c.SaveTorrent(torrent) c.setTorrent(torrent, func(torrent CachedTorrent) {
c.listingDebouncer.Call(false)
})
} }
} }