From 19c9df2ce4d7d5333467e81a478aebaf9e70a922 Mon Sep 17 00:00:00 2001 From: jake Date: Tue, 6 Feb 2024 09:51:35 -0800 Subject: [PATCH] Fixed bug in append mode --- internetarchive/iarequest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internetarchive/iarequest.py b/internetarchive/iarequest.py index 4df3bb63..f93d3fd4 100644 --- a/internetarchive/iarequest.py +++ b/internetarchive/iarequest.py @@ -342,10 +342,10 @@ def prepare_patch(metadata, source_metadata, append, append_list=None, insert=No continue if len(path_parts) == 2: src_val = source_metadata.get(path_parts[-1]) + p_test = {'op': 'test', 'path': p['path'], 'value': src_val} else: - index = int(path_parts[-1]) - 1 - src_val = source_metadata.get(path_parts[1], [])[index] - p_test = {'op': 'test', 'path': p['path'], 'value': src_val} + src_val = source_metadata.get(path_parts[1], []) + p_test = {'op': 'test', 'path': '/' + path_parts[1], 'value': src_val} patch_tests.append(p_test) final_patch = patch_tests + patch