mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
feat(actions): rtorrent add folder rename toggle (#756)
* feat(actions): rtorrent add folder rename toggle * refactor: use content layout
This commit is contained in:
parent
4449df66aa
commit
9fed6b3735
3 changed files with 38 additions and 9 deletions
|
@ -41,10 +41,17 @@ func (s *service) rtorrent(ctx context.Context, action *domain.Action, release d
|
|||
})
|
||||
}
|
||||
if action.SavePath != "" {
|
||||
args = append(args, &rtorrent.FieldValue{
|
||||
Field: rtorrent.DDirectory,
|
||||
Value: action.SavePath,
|
||||
})
|
||||
if action.ContentLayout == domain.ActionContentLayoutSubfolderNone {
|
||||
args = append(args, &rtorrent.FieldValue{
|
||||
Field: "d.directory_base",
|
||||
Value: action.SavePath,
|
||||
})
|
||||
} else {
|
||||
args = append(args, &rtorrent.FieldValue{
|
||||
Field: rtorrent.DDirectory,
|
||||
Value: action.SavePath,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if err := rt.Add(release.MagnetURI, args...); err != nil {
|
||||
|
@ -77,10 +84,17 @@ func (s *service) rtorrent(ctx context.Context, action *domain.Action, release d
|
|||
})
|
||||
}
|
||||
if action.SavePath != "" {
|
||||
args = append(args, &rtorrent.FieldValue{
|
||||
Field: rtorrent.DDirectory,
|
||||
Value: action.SavePath,
|
||||
})
|
||||
if action.ContentLayout == domain.ActionContentLayoutSubfolderNone {
|
||||
args = append(args, &rtorrent.FieldValue{
|
||||
Field: "d.directory_base",
|
||||
Value: action.SavePath,
|
||||
})
|
||||
} else {
|
||||
args = append(args, &rtorrent.FieldValue{
|
||||
Field: rtorrent.DDirectory,
|
||||
Value: action.SavePath,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if err := rt.AddTorrent(tmpFile, args...); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue