mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
Feature: Download client rules (#18)
* feat(web): add and update download client rules * feat: add and update download client rules * feat: add active downloads check * chore: update pkg * feat: deluge max active downloads * feat: use basic rules for deluge * feat: add as paused * refactor: download file if needed * feat: better errors qbit
This commit is contained in:
parent
09eb0b1716
commit
c02f16b64d
25 changed files with 628 additions and 228 deletions
|
@ -11,12 +11,12 @@ import (
|
|||
)
|
||||
|
||||
func (s *service) execCmd(announce domain.Announce, action domain.Action, torrentFile string) {
|
||||
log.Trace().Msgf("action EXEC: release: %v", announce.TorrentName)
|
||||
log.Debug().Msgf("action exec: %v release: %v", action.Name, announce.TorrentName)
|
||||
|
||||
// check if program exists
|
||||
cmd, err := exec.LookPath(action.ExecCmd)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msgf("exec failed, could not find program: %v", action.ExecCmd)
|
||||
log.Error().Stack().Err(err).Msgf("exec failed, could not find program: %v", action.ExecCmd)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ func (s *service) execCmd(announce domain.Announce, action domain.Action, torren
|
|||
// parse and replace values in argument string before continuing
|
||||
parsedArgs, err := m.Parse(action.ExecArgs)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msgf("exec failed, could not parse arguments: %v", action.ExecCmd)
|
||||
log.Error().Stack().Err(err).Msgf("exec failed, could not parse arguments: %v", action.ExecCmd)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ func (s *service) execCmd(announce domain.Announce, action domain.Action, torren
|
|||
output, err := command.CombinedOutput()
|
||||
if err != nil {
|
||||
// everything other than exit 0 is considered an error
|
||||
log.Error().Err(err).Msgf("command: %v args: %v failed, torrent: %v", cmd, parsedArgs, torrentFile)
|
||||
log.Error().Stack().Err(err).Msgf("command: %v args: %v failed, torrent: %v", cmd, parsedArgs, torrentFile)
|
||||
}
|
||||
|
||||
log.Trace().Msgf("executed command: '%v'", string(output))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue