Skip to content

Commit

Permalink
fix(rules): Don't trip on ebook metadata when source identified but n…
Browse files Browse the repository at this point in the history
…ot with a title
  • Loading branch information
alerque committed Sep 29, 2023
1 parent 2ab757a commit 51cb99c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rules/ebooks.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DISTFILES += $(EPUBS)

$(BUILDDIR)/%-epub-metadata.yml: $$(call parse_bookid,$$*)-manifest.yml %-epub-$(_poster).jpg | $(BUILDDIR)
echo '---' > $@
$(YQ) -M -e -y '{title: [ { type: "main", text: .title }, { type: "subtitle", text: .subtitle } ], creator: .creator, contributor: .contributor, identifier: .identifier, date: .date | last | .text, published: .date | first | .text, lang: .lang, description: .abstract, rights: .rights, publisher: .publisher, source: (if .source then (.source[]? | select(.type == "title").text) else null end), "cover-image": "$(filter %.jpg,$^)" }' < $< >> $@
$(YQ) -M -e -y '{title: [ { type: "main", text: .title }, { type: "subtitle", text: .subtitle } ], creator: .creator, contributor: .contributor, identifier: .identifier, date: .date | last | .text, published: .date | first | .text, lang: .lang, description: .abstract, rights: .rights, publisher: .publisher, source: (if .source then (try (.source[]? | map(select(.type == "title"))[0].text) // null) else null end), "cover-image": "$(filter %.jpg,$^)" }' < $< >> $@
echo '...' >> $@

MOBIS := $(call pattern_list,$(EDITIONEDITSOURCES),.mobi)
Expand Down

0 comments on commit 51cb99c

Please sign in to comment.