diff --git a/database.go b/database.go index 775ab5d..5602dc7 100644 --- a/database.go +++ b/database.go @@ -23,6 +23,7 @@ type Book struct { Subject []string Date string Lang []string + Isbn string Type string Format string Source string diff --git a/store.go b/store.go index 4cc8b7e..c0e54c3 100644 --- a/store.go +++ b/store.go @@ -39,6 +39,13 @@ func ParseFile(path string) (string, error) { book["lang"] = data case "title", "contributor", "publisher": book[m] = cleanStr(strings.Join(data, ", ")) + case "identifier": + attr, _ := e.MetadataAttr(m) + for i, d := range data { + if attr[i]["scheme"] == "ISBN" { + book["isbn"] = d + } + } default: book[m] = strings.Join(data, ", ") } diff --git a/templates/book.html b/templates/book.html index c1eadcc..da55144 100644 --- a/templates/book.html +++ b/templates/book.html @@ -37,6 +37,7 @@ function delBook(){ {{if .Author}}
Author
{{range .Author}}{{.}}, {{end}}
{{end}} {{if .Publisher}}
Publisher
{{.Publisher}}
{{end}} {{if .Subject}}
Tags
{{range .Subject}}{{.}}, {{end}}
{{end}} + {{if .Isbn}}
ISBN
{{.Isbn}}
{{end}} {{if .Date}}
Date
{{.Date}}
{{end}} {{if .Lang}}
Lang
{{range .Lang}}{{.}} {{end}}
{{end}} diff --git a/templates/new.html b/templates/new.html index 7064fe7..7cb976f 100644 --- a/templates/new.html +++ b/templates/new.html @@ -33,6 +33,7 @@ {{if .Author}}Author: {{range .Author}}{{.}}, {{end}} ({{$authorFound}})
{{end}} {{if .Publisher}}Publisher: {{.Publisher}}
{{end}} {{if .Subject}}Tags: {{range .Subject}}{{.}}, {{end}}
{{end}} + {{if .Isbn}}ISBN: {{.Isbn}}
{{end}} {{if .Date}}Date: {{.Date}}
{{end}} {{if .Lang}}Lang: {{range .Lang}}{{.}} {{end}}
{{end}} {{.Description}}