This commit is contained in:
Mukhtar Akere
2024-08-26 02:22:21 +01:00
parent ad1ba7b505
commit 511df1a296
4 changed files with 16 additions and 13 deletions
+5 -2
View File
@@ -31,8 +31,13 @@ func (r *RealDebrid) Process(arr *Arr, magnet string) (*Torrent, error) {
if !r.IsAvailable(torrent.Magnet) {
return torrent, fmt.Errorf("torrent is not cached")
}
log.Printf("Torrent: %s is cached", torrent.Name)
}
torrent, err = r.SubmitMagnet(torrent)
if err != nil || torrent.Id == "" {
return nil, err
}
return r.CheckStatus(torrent)
}
@@ -49,10 +54,8 @@ func (r *RealDebrid) IsAvailable(magnet *common.Magnet) bool {
}
hosters, exists := data[strings.ToLower(magnet.InfoHash)]
if !exists || len(hosters) < 1 {
log.Printf("Torrent: %s not cached", magnet.Name)
return false
}
log.Printf("Torrent: %s is cached", magnet.Name)
return true
}