Fixes on merge behavior; remove downloads cap
This commit is contained in:
@@ -342,12 +342,10 @@ func (t *TorrentManager) mountNewDownloads() {
|
||||
downloads := t.api.GetDownloads()
|
||||
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(downloads[i].Link) {
|
||||
t.UnrestrictMap.Set(downloads[i].Link, &downloads[i])
|
||||
}
|
||||
if isRealDebrid {
|
||||
t.UnrestrictMap.SetIfAbsent(downloads[i].Link[0:39], &downloads[i])
|
||||
} else {
|
||||
t.UnrestrictMap.SetIfAbsent(downloads[i].Link, &downloads[i])
|
||||
filename := filepath.Base(downloads[i].Filename)
|
||||
t.DownloadMap.Set(filename, &downloads[i])
|
||||
}
|
||||
@@ -362,6 +360,7 @@ func (t *TorrentManager) StartDownloadsJob() {
|
||||
for {
|
||||
select {
|
||||
case <-remountTicker.C:
|
||||
t.DownloadMap.Clear()
|
||||
t.mountNewDownloads()
|
||||
case <-t.RemountTrigger:
|
||||
t.DownloadMap.Clear()
|
||||
|
||||
Reference in New Issue
Block a user