Compare commits
2 commits
5120d13117
...
9d334f1e9b
Author | SHA1 | Date | |
---|---|---|---|
9d334f1e9b | |||
5bac2211fe |
2 changed files with 77 additions and 9 deletions
|
@ -1,4 +1,63 @@
|
||||||
[
|
[
|
||||||
|
{
|
||||||
|
"ol_id": "OL20374699W",
|
||||||
|
"title": "Overcoming Evil",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"ol_id": "OL1009182A",
|
||||||
|
"name": "Ervin Staub"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"subjects": [
|
||||||
|
"Conflict management",
|
||||||
|
"Genocide",
|
||||||
|
"Violence",
|
||||||
|
"Aggressiveness",
|
||||||
|
"Social groups",
|
||||||
|
"Terrorism, prevention",
|
||||||
|
"Violence, prevention"
|
||||||
|
],
|
||||||
|
"date_added": "2024-03-17"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ol_id": "OL17798579W",
|
||||||
|
"title": "Fundamentals of Genocide and Mass Atrocity Prevention",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"ol_id": "OL6963633A",
|
||||||
|
"name": "Scott Straus"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"subjects": [
|
||||||
|
"Verbrechen gegen die Menschlichkeit",
|
||||||
|
"Kriegsverbrechen",
|
||||||
|
"Vertreibung",
|
||||||
|
"Pra vention",
|
||||||
|
"Genocide",
|
||||||
|
"Vo lkermord",
|
||||||
|
"Atrocities",
|
||||||
|
"Prevention",
|
||||||
|
"Pr\u00e4vention",
|
||||||
|
"V\u00f6lkermord"
|
||||||
|
],
|
||||||
|
"date_added": "2024-03-17"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ol_id": "OL17478608W",
|
||||||
|
"title": "Crap Days Out",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"ol_id": "OL7325839A",
|
||||||
|
"name": "Gareth Rubin"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"subjects": [
|
||||||
|
"Humor, topic, marriage & family",
|
||||||
|
"Family recreation",
|
||||||
|
"Humor"
|
||||||
|
],
|
||||||
|
"date_added": "2024-03-17"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"ol_id": "OL23279299W",
|
"ol_id": "OL23279299W",
|
||||||
"title": "Soldier box",
|
"title": "Soldier box",
|
||||||
|
|
|
@ -178,19 +178,28 @@ def add_item_to_log(item_id: str, media_type: str, log: str) -> None:
|
||||||
raise Exception("No item found")
|
raise Exception("No item found")
|
||||||
|
|
||||||
if "books" == media_type:
|
if "books" == media_type:
|
||||||
|
new_item = None
|
||||||
|
if "work" in "ol_id":
|
||||||
new_item, log_to_delete = check_for_existing(
|
new_item, log_to_delete = check_for_existing(
|
||||||
item["work"]["ol_id"], media_type, log
|
item["work"]["ol_id"], media_type, log
|
||||||
)
|
)
|
||||||
|
|
||||||
if new_item is None:
|
if new_item is None:
|
||||||
|
if "ol_id" in item:
|
||||||
new_item, log_to_delete = check_for_existing(item["ol_id"], media_type, log)
|
new_item, log_to_delete = check_for_existing(item["ol_id"], media_type, log)
|
||||||
|
|
||||||
if new_item is None:
|
if new_item is None:
|
||||||
|
if "isbn_13" in item:
|
||||||
new_item, log_to_delete = check_for_existing(
|
new_item, log_to_delete = check_for_existing(
|
||||||
item["isbn_13"], media_type, log
|
item["isbn_13"], media_type, log
|
||||||
)
|
)
|
||||||
|
|
||||||
if new_item is None:
|
if new_item is None:
|
||||||
|
if "isbn_10" in item:
|
||||||
new_item, log_to_delete = check_for_existing(
|
new_item, log_to_delete = check_for_existing(
|
||||||
item["isbn_10"], media_type, log
|
item["isbn_10"], media_type, log
|
||||||
)
|
)
|
||||||
|
|
||||||
item = new_item if new_item is not None else item
|
item = new_item if new_item is not None else item
|
||||||
|
|
||||||
if log in ["log", "current"]:
|
if log in ["log", "current"]:
|
||||||
|
|
Loading…
Reference in a new issue