From d5c135a0cd257a3f6ef4f5d7bbd05ffe42432813 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Mon, 13 Jan 2025 23:01:11 +0100 Subject: [PATCH] fix data.ID parsing in jsonfeed reader --- cmd/root.go | 2 +- jsonfeed/reader.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index f4960e0..c144b01 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -13,7 +13,7 @@ import ( // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ Use: "commonmeta", - Version: "v0.6.28", + Version: "v0.6.29", Short: "Convert scholarly metadata from one format to another", Long: `Convert scholarly metadata between formats. Currently supported input formats are Crossref and DataCite DOIs, currently diff --git a/jsonfeed/reader.go b/jsonfeed/reader.go index 0e40bc1..86a91ce 100644 --- a/jsonfeed/reader.go +++ b/jsonfeed/reader.go @@ -276,7 +276,7 @@ func Read(content Content) (commonmeta.Data, error) { if data.ID == "" && content.Blog.Prefix != "" { // optionally generate a DOI string if missing but a DOI prefix is provided data.ID = doiutils.EncodeDOI(content.Blog.Prefix) - } else { + } else if data.ID == "" { data.ID = content.URL } data.Type = "Article"