This commit is contained in:
Mukhtar Akere
2025-04-29 12:07:01 +01:00
parent 6c2bfa811a
commit c0703cb622
3 changed files with 5 additions and 4 deletions

View File

@@ -428,10 +428,10 @@ func (c *Cache) setTorrent(t *CachedTorrent) {
// keep the one with the most recent added date
// Save the most recent torrent
mergedFiles := mergeFiles(t, o) // Useful for merging files across multiple torrents, while keeping the most recent
if o.AddedOn.After(t.AddedOn) {
t = o
}
mergedFiles := mergeFiles(t, o) // Useful for merging files across multiple torrents, while keeping the most recent
t.Files = mergedFiles
}
@@ -445,10 +445,10 @@ func (c *Cache) setTorrents(torrents map[string]*CachedTorrent) {
c.torrents.Store(t.Id, torrentKey)
if o, ok := c.torrentsNames.Load(torrentKey); ok && o.Id != t.Id {
// Save the most recent torrent
mergedFiles := mergeFiles(t, o) // Useful for merging files across multiple torrents, while keeping the most recent
if o.AddedOn.After(t.AddedOn) {
t = o
}
mergedFiles := mergeFiles(t, o)
t.Files = mergedFiles
}
c.torrentsNames.Store(torrentKey, t)