Compare commits
2 commits
2996c4ad97
...
e2ac8e18f0
Author | SHA1 | Date | |
---|---|---|---|
e2ac8e18f0 | |||
0d6c9907e5 |
3 changed files with 29 additions and 25 deletions
|
@ -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"
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue