Fix issue with range loop
This commit is contained in:
@@ -14,8 +14,9 @@ COPY --from=builder /app/zurg .
|
||||
COPY ./healthcheck.sh /app/healthcheck.sh
|
||||
RUN chmod +x /app/healthcheck.sh
|
||||
COPY config.example.yml /app/config.yml
|
||||
|
||||
# Install runtime dependencies and configure FUSE
|
||||
RUN apk add curl python3 libxml2-utils
|
||||
RUN apk add --no-cache curl python3 libxml2-utils ffmpeg
|
||||
|
||||
HEALTHCHECK --interval=60s --timeout=60s --start-period=10s --retries=10 CMD /app/healthcheck.sh
|
||||
|
||||
|
||||
@@ -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