Skip to content

Commit

Permalink
use guid as doi in jsonfeed reader
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed Jan 13, 2025
1 parent 652ae13 commit 6da09f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "commonmeta",
Version: "v0.6.27",
Version: "v0.6.28",
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
Expand Down
5 changes: 4 additions & 1 deletion jsonfeed/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,10 @@ func Read(content Content) (commonmeta.Data, error) {

if content.DOI != "" {
data.ID = doiutils.NormalizeDOI(content.DOI)
} else if content.Blog.Prefix != "" {
} else if content.GUID != "" {
data.ID = doiutils.NormalizeDOI(content.GUID)
}
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 {
Expand Down

0 comments on commit 6da09f0

Please sign in to comment.