mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
feat(releases): retry failed downloads (#491)
* feat(download): implement parsing and retry * feat: retry torrent file downloads * refactor: error handling downloadtorrentfile * feat: add tests for download torrent file * build: add runs-on self-hosted * build: add runs-on self-hosted
This commit is contained in:
parent
5183f7683a
commit
2d8f7aeb4e
10 changed files with 349 additions and 143 deletions
|
@ -68,8 +68,7 @@ func (s *service) qbittorrent(action domain.Action, release domain.Release) ([]s
|
|||
}
|
||||
|
||||
if release.TorrentTmpFile == "" {
|
||||
err = release.DownloadTorrentFile()
|
||||
if err != nil {
|
||||
if err := release.DownloadTorrentFile(); err != nil {
|
||||
return nil, errors.Wrap(err, "error downloading torrent file for release: %v", release.TorrentName)
|
||||
}
|
||||
}
|
||||
|
@ -279,11 +278,12 @@ func (s *service) reannounceTorrent(qb *qbittorrent.Client, action domain.Action
|
|||
|
||||
// Check if status not working or something else
|
||||
// https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-trackers
|
||||
// 0 Tracker is disabled (used for DHT, PeX, and LSD)
|
||||
// 1 Tracker has not been contacted yet
|
||||
// 2 Tracker has been contacted and is working
|
||||
// 3 Tracker is updating
|
||||
// 4 Tracker has been contacted, but it is not working (or doesn't send proper replies)
|
||||
//
|
||||
// 0 Tracker is disabled (used for DHT, PeX, and LSD)
|
||||
// 1 Tracker has not been contacted yet
|
||||
// 2 Tracker has been contacted and is working
|
||||
// 3 Tracker is updating
|
||||
// 4 Tracker has been contacted, but it is not working (or doesn't send proper replies)
|
||||
func isTrackerStatusOK(trackers []qbittorrent.TorrentTracker) bool {
|
||||
for _, tracker := range trackers {
|
||||
if tracker.Status == qbittorrent.TrackerStatusDisabled {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue