fix: warning for deletion failure
This commit is contained in:
parent
0d6c9907e5
commit
528e1733ee
1 changed files with 2 additions and 0 deletions
|
@ -118,6 +118,8 @@ def delete_existing(item_id: str, media_type: str, log: str) -> None:
|
||||||
]
|
]
|
||||||
if len(log_items) < (old_len - 1):
|
if len(log_items) < (old_len - 1):
|
||||||
raise Exception("More than one deletion made, discarding…")
|
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:
|
with open(f"./data/{media_type}/{log}.json", "w", encoding="utf-8") as log_file:
|
||||||
json.dump(log_items, log_file, indent=4)
|
json.dump(log_items, log_file, indent=4)
|
||||||
|
|
Loading…
Reference in a new issue