diff options
Diffstat (limited to 'skate')
-rw-r--r-- | skate/map.go | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/skate/map.go b/skate/map.go index 17d9ed2..a6dc5f3 100644 --- a/skate/map.go +++ b/skate/map.go @@ -289,22 +289,13 @@ func MapperOpenLibraryReleaseNormalizedISBN(p []byte) (fields [][]byte, err erro } // There can be 10 and 13 variants in the data, we always want 13. for _, isbn := range doc.ExtIDs.ISBN { - if len(isbn) == 13 { - isbn13 = isbn + parsed := ParseIsbn(isbn) + if len(parsed) > 0 { + isbn13 = parsed[0] break } } if isbn13 == "" { - // This is rarer, more expensive. - for _, isbn := range doc.ExtIDs.ISBN { - parsed := ParseIsbn(isbn) - if len(parsed) > 0 { - isbn13 = parsed[0] - break - } - } - } - if isbn13 == "" { return nil, nil } else { key = []byte(isbn13) |