diff --git a/scripts/add_item.py b/scripts/add_item.py index 2637abd..36966b0 100644 --- a/scripts/add_item.py +++ b/scripts/add_item.py @@ -118,6 +118,8 @@ def delete_existing(item_id: str, media_type: str, log: str) -> None: ] if len(log_items) < (old_len - 1): raise Exception("More than one deletion made, discarding…") + elif len(log_items) == old_len: + raise Exception("No item deleted, skipping…") with open(f"./data/{media_type}/{log}.json", "w", encoding="utf-8") as log_file: json.dump(log_items, log_file, indent=4)