Compare commits

...

2 Commits

3 changed files with 29 additions and 25 deletions

View File

@ -1,4 +1,30 @@
[
{
"ol_id": "OL3621057W",
"title": "Against His-Story, Against Leviathan!",
"first_publish_date": "June 1983",
"subjects": [
"Anarchism",
"Anarcho-Primitivism",
"Civilization",
"Miscellanea",
"Leviathan",
"History",
"Potawatomi Indians"
],
"authors": [
{
"ol_id": "OL616358A",
"name": "Fredy Perlman"
}
],
"languages": [
"eng"
],
"date_added": "2013-05-08",
"date_started": "2024-03-14",
"added_by_id": "9781909798311"
},
{
"publishers": [
"O'Reilly Media"
@ -133,4 +159,4 @@
"date_added": "2024-01-02",
"date_started": "2023-12-25"
}
]
]

View File

@ -28011,30 +28011,6 @@
],
"date_added": "2013-05-07"
},
{
"ol_id": "OL3621057W",
"title": "Against His-Story, Against Leviathan!",
"first_publish_date": "June 1983",
"subjects": [
"Anarchism",
"Anarcho-Primitivism",
"Civilization",
"Miscellanea",
"Leviathan",
"History",
"Potawatomi Indians"
],
"authors": [
{
"ol_id": "OL616358A",
"name": "Fredy Perlman"
}
],
"languages": [
"eng"
],
"date_added": "2013-05-08"
},
{
"ol_id": "OL15829104W",
"title": "Against love",

View File

@ -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…"s)
with open(f"./data/{media_type}/{log}.json", "w", encoding="utf-8") as log_file:
json.dump(log_items, log_file, indent=4)