From be4fac1ac1a9b8866da8d22c891d3c7e984ec133 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Wed, 7 Jun 2023 09:09:43 +0200 Subject: [PATCH] scripts/ref: fix parsing --- scripts/ref | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ref b/scripts/ref index bdaa471..4373b3d 100755 --- a/scripts/ref +++ b/scripts/ref @@ -19,10 +19,10 @@ else | ($reply.data + $reply.details) as $data | [{author: $data.authors | map(.name | splitname), isbn: $data.identifiers.isbn_10[0], - edition: $data.details.edition_name | split(" ") | .[0] | sub("[a-z]+"; ""), + edition: $data.details | (.edition_name // "1") | split(" ") | .[0] | sub("[a-z]+"; ""), issued: $data.publish_date, publisher: $data.details.publishers[0], - "publisher-place": $data.details.publish_places[0], + "publisher-place": $data.details | (.publish_places[0] // "Nowhere"), type: "book", title: $data.title, url: ("https://www.worldcat.org/oclc/" + $oclc)}]' \