Save when its complete

This commit is contained in:
Ben Sarmiento
2024-02-17 02:23:38 +01:00
parent 95882ace3f
commit 586466ce80
2 changed files with 17 additions and 13 deletions

View File

@@ -220,16 +220,13 @@ func (t *TorrentManager) getMoreInfo(rdTorrent realdebrid.Torrent) *Torrent {
}
torrent.DownloadedIDs = mapset.NewSet[string]()
torrent.InProgressIDs = mapset.NewSet[string]()
if info.Progress == 100 {
if rdTorrent.Progress == 100 {
torrent.DownloadedIDs.Add(info.ID)
} else {
torrent.InProgressIDs.Add(info.ID)
}
// save to cache if it's not in progress anymore
if info.Progress == 100 {
// save to cache if it's not in progress anymore
infoCache.Set(rdTorrent.ID, &torrent)
t.saveTorrentChangesToDisk(&torrent, nil)
} else {
torrent.InProgressIDs.Add(info.ID)
}
return &torrent