Fixes search data and new activitypub fields

This commit is contained in:
Mouse Reeve
2021-04-06 18:00:54 -07:00
parent 82c2f2eeb1
commit 4112862924
3 changed files with 22 additions and 19 deletions

View File

@ -7,7 +7,17 @@ from .image import Image
@dataclass(init=False)
class Book(ActivityObject):
class BookData(ActivityObject):
""" shared fields for all book data and authors"""
openlibraryKey: str = None
inventaireId: str = None
librarythingKey: str = None
goodreadsKey: str = None
bnfId: str = None
@dataclass(init=False)
class Book(BookData):
""" serializes an edition or work, abstract """
title: str
@ -24,11 +34,6 @@ class Book(ActivityObject):
firstPublishedDate: str = ""
publishedDate: str = ""
openlibraryKey: str = None
inventaireId: str = None
librarythingKey: str = None
goodreadsKey: str = None
cover: Image = None
type: str = "Book"
@ -61,17 +66,16 @@ class Work(Book):
@dataclass(init=False)
class Author(ActivityObject):
class Author(BookData):
""" author of a book """
name: str
isni: str = None
viafId: str = None
gutenbergId: str = None
born: str = None
died: str = None
aliases: List[str] = field(default_factory=lambda: [])
bio: str = ""
openlibraryKey: str = None
inventaireId: str = None
librarythingKey: str = None
goodreadsKey: str = None
wikipediaLink: str = ""
type: str = "Author"