Changelog 0.2.3

This commit is contained in:
Mukhtar Akere
2024-09-17 00:29:02 +01:00
parent 2ec0354881
commit 01981114cb
5 changed files with 71 additions and 25 deletions

View File

@@ -203,15 +203,28 @@ func (r *RealDebrid) CheckStatus(torrent *Torrent) (*Torrent, error) {
break
} else if status == "downloading" {
if !r.DownloadUncached {
// @TODO: Delete the torrent if it's not cached
go r.DeleteTorrent(torrent)
return torrent, fmt.Errorf("torrent: %s not cached", torrent.Name)
}
// Break out of the loop if the torrent is downloading.
// This is necessary to prevent infinite loop since we moved to sync downloading and async processing
break
}
}
return torrent, nil
}
func (r *RealDebrid) DeleteTorrent(torrent *Torrent) {
url := fmt.Sprintf("%s/torrents/delete/%s", r.Host, torrent.Id)
_, err := r.client.MakeRequest(http.MethodDelete, url, nil)
if err == nil {
r.logger.Printf("Torrent: %s deleted\n", torrent.Name)
} else {
r.logger.Printf("Error deleting torrent: %s", err)
}
}
func (r *RealDebrid) DownloadLink(torrent *Torrent) error {
return nil
}