Fix issue with range loop
This commit is contained in:
@@ -317,16 +317,16 @@ func (t *TorrentManager) deleteInfoFile(torrentID string) {
|
||||
|
||||
func (t *TorrentManager) mountNewDownloads() {
|
||||
downloads := t.api.GetDownloads()
|
||||
for _, download := range downloads {
|
||||
isRealDebrid := strings.HasPrefix(download.Link, "https://real-debrid.com/d/")
|
||||
if isRealDebrid && !t.UnrestrictMap.Has(download.Link[0:39]) {
|
||||
t.UnrestrictMap.Set(download.Link[0:39], &download)
|
||||
for i := range downloads {
|
||||
isRealDebrid := strings.HasPrefix(downloads[i].Link, "https://real-debrid.com/d/")
|
||||
if isRealDebrid && !t.UnrestrictMap.Has(downloads[i].Link[0:39]) {
|
||||
t.UnrestrictMap.Set(downloads[i].Link[0:39], &downloads[i])
|
||||
} else if !isRealDebrid {
|
||||
if !t.UnrestrictMap.Has(download.Link) {
|
||||
t.UnrestrictMap.Set(download.Link, &download)
|
||||
if !t.UnrestrictMap.Has(downloads[i].Link) {
|
||||
t.UnrestrictMap.Set(downloads[i].Link, &downloads[i])
|
||||
}
|
||||
filename := filepath.Base(download.Filename)
|
||||
t.DownloadMap.Set(filename, &download)
|
||||
filename := filepath.Base(downloads[i].Filename)
|
||||
t.DownloadMap.Set(filename, &downloads[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user