From 1da20c73e741e3bea67e13b6aca64973e9511621 Mon Sep 17 00:00:00 2001 From: F4n4t Date: Thu, 10 Aug 2023 21:46:32 +0200 Subject: [PATCH] convert post-processing parameters into a slice of strings --- methods.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/methods.go b/methods.go index 81fb5ee..a8b2d7c 100644 --- a/methods.go +++ b/methods.go @@ -420,6 +420,11 @@ func (n *NZBGet) Append(input *AppendInput) (int64, error) { // AppendContext adds a nzb-file or URL to the download queue. // https://nzbget.net/api/append func (n *NZBGet) AppendContext(ctx context.Context, input *AppendInput) (int64, error) { + var parameters [][]string + for _, p := range input.Parameters { + parameters = append(parameters, []string{p.Name, p.Value}) + } + var output int64 err := n.GetInto(ctx, "append", &output, input.Filename, @@ -431,7 +436,7 @@ func (n *NZBGet) AppendContext(ctx context.Context, input *AppendInput) (int64, input.DupeKey, input.DupeScore, input.DupeMode, - input.Parameters, + parameters, ) return output, err