Fix for invalid_download_code
This commit is contained in:
@@ -180,6 +180,12 @@ func (t *TorrentManager) getMoreInfo(rdTorrent realdebrid.Torrent) *realdebrid.T
|
||||
}
|
||||
t.writeInfoToFile(info)
|
||||
}
|
||||
for i := range info.Links {
|
||||
if strings.HasPrefix(info.Links[i], "https://real-debrid.com/d/") {
|
||||
// set link to max 39 chars (26 + 13)
|
||||
info.Links[i] = info.Links[i][0:39]
|
||||
}
|
||||
}
|
||||
return info
|
||||
}
|
||||
|
||||
@@ -226,9 +232,6 @@ func (t *TorrentManager) convertToTorrent(info *realdebrid.TorrentInfo) *Torrent
|
||||
// all links are still intact! good!
|
||||
for i, file := range selectedFiles {
|
||||
file.Link = info.Links[i]
|
||||
if strings.HasPrefix(file.Link, "https://real-debrid.com/d/") {
|
||||
file.Link = file.Link[0:39]
|
||||
}
|
||||
file.State.Event(context.Background(), "repair_file")
|
||||
}
|
||||
torrent.UnassignedLinks = mapset.NewSet[string]()
|
||||
@@ -236,9 +239,6 @@ func (t *TorrentManager) convertToTorrent(info *realdebrid.TorrentInfo) *Torrent
|
||||
} else {
|
||||
torrent.UnassignedLinks = mapset.NewSet[string]()
|
||||
for _, link := range info.Links {
|
||||
if strings.HasPrefix(link, "https://real-debrid.com/d/") {
|
||||
link = link[0:39]
|
||||
}
|
||||
torrent.UnassignedLinks.Add(link)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user