aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-07-10 03:39:52 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-07-10 03:39:52 +0200
commit09fe6b8b63cb16e71a05b7b9480ef46d34009456 (patch)
tree83930bd26cda74d9da21f12faade681b66460090
parent7a98d6d6bc7ee134dce736d2700233a315f56ea4 (diff)
downloadrefcat-09fe6b8b63cb16e71a05b7b9480ef46d34009456.tar.gz
refcat-09fe6b8b63cb16e71a05b7b9480ef46d34009456.zip
schema: prefer isbn13
-rw-r--r--skate/schema.go6
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()
}