aboutsummaryrefslogtreecommitdiffstats
path: root/skate/schema.go
diff options
context:
space:
mode:
Diffstat (limited to 'skate/schema.go')
-rw-r--r--skate/schema.go62
1 files changed, 60 insertions, 2 deletions
diff --git a/skate/schema.go b/skate/schema.go
index f97b55a..42587b9 100644
--- a/skate/schema.go
+++ b/skate/schema.go
@@ -426,8 +426,8 @@ type OpenLibraryWork struct {
Version int64 `json:"_version_"`
}
-// OpenLibraryToRelease convert OL data into a release. XXX: release/work?
-func OpenLibraryToRelease(w *OpenLibraryWork) (*Release, error) {
+// OpenLibraryWorkToRelease convert OL data into a release. XXX: release/work?
+func OpenLibraryWorkToRelease(w *OpenLibraryWork) (*Release, error) {
var (
release Release
contribs = make([]struct {
@@ -462,3 +462,61 @@ func OpenLibraryToRelease(w *OpenLibraryWork) (*Release, error) {
release.Extra.OpenLibrary.HasFulltext = w.HasFulltext
return &release, nil
}
+
+type OpenLibraryEdition struct {
+ Authors []struct {
+ Key string `json:"key"`
+ } `json:"authors"`
+ ByStatement string `json:"by_statement"`
+ Covers []int64 `json:"covers"`
+ Created struct {
+ Type string `json:"type"`
+ Value string `json:"value"`
+ } `json:"created"`
+ DeweyDecimalClass []string `json:"dewey_decimal_class"`
+ Genres []string `json:"genres"`
+ Identifiers struct {
+ Goodreads []string `json:"goodreads"`
+ Librarything []string `json:"librarything"`
+ } `json:"identifiers"`
+ Isbn10 []string `json:"isbn_10"`
+ Key string `json:"key"`
+ Languages []struct {
+ Key string `json:"key"`
+ } `json:"languages"`
+ LastModified struct {
+ Type string `json:"type"`
+ Value string `json:"value"`
+ } `json:"last_modified"`
+ LatestRevision int64 `json:"latest_revision"`
+ LcClassifications []string `json:"lc_classifications"`
+ Lccn []string `json:"lccn"`
+ Notes struct {
+ Type string `json:"type"`
+ Value string `json:"value"`
+ } `json:"notes"`
+ NumberOfPages int64 `json:"number_of_pages"`
+ Ocaid string `json:"ocaid"`
+ Pagination string `json:"pagination"`
+ PublishCountry string `json:"publish_country"`
+ PublishDate string `json:"publish_date"`
+ PublishPlaces []string `json:"publish_places"`
+ Publishers []string `json:"publishers"`
+ Revision int64 `json:"revision"`
+ SourceRecords []string `json:"source_records"`
+ SubjectPlace []string `json:"subject_place"`
+ Subjects []string `json:"subjects"`
+ Subtitle string `json:"subtitle"`
+ Title string `json:"title"`
+ Type struct {
+ Key string `json:"key"`
+ } `json:"type"`
+ Works []struct {
+ Key string `json:"key"`
+ } `json:"works"`
+}
+
+// OpenLibraryEditionToRelease convert OL data into a release. XXX: release/work?
+func OpenLibraryEditionToRelease(w *OpenLibraryEdition) (*Release, error) {
+ return nil, nil
+}