Skip to content

Commit

Permalink
Fixed bug in append mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jake authored and jake committed Feb 6, 2024
1 parent c27440e commit 19c9df2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internetarchive/iarequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 19c9df2

Please sign in to comment.