diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-07-10 03:39:52 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-07-10 03:39:52 +0200 |
commit | 09fe6b8b63cb16e71a05b7b9480ef46d34009456 (patch) | |
tree | 83930bd26cda74d9da21f12faade681b66460090 /skate | |
parent | 7a98d6d6bc7ee134dce736d2700233a315f56ea4 (diff) | |
download | refcat-09fe6b8b63cb16e71a05b7b9480ef46d34009456.tar.gz refcat-09fe6b8b63cb16e71a05b7b9480ef46d34009456.zip |
schema: prefer isbn13
Diffstat (limited to 'skate')
-rw-r--r-- | skate/schema.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/skate/schema.go b/skate/schema.go index 2d90735..0fd429f 100644 --- a/skate/schema.go +++ b/skate/schema.go @@ -190,7 +190,11 @@ func ReleaseToUnstructured(r *Release) string { if buf.Len() > 0 { fmt.Fprintf(&buf, ", ") } - fmt.Fprintf(&buf, `%s`, r.ExtIDs.ISBN[0]) + if isbn13, err := isbn.To13(r.ExtIDs.ISBN[0]); err == nil { + fmt.Fprintf(&buf, `%s`, isbn13) + } else { + fmt.Fprintf(&buf, `%s`, r.ExtIDs.ISBN[0]) + } } return buf.String() } |