2020-09-21 15:10:37 +00:00
|
|
|
''' using another bookwyrm instance as a source of book data '''
|
2020-11-25 00:05:00 +00:00
|
|
|
from bookwyrm import activitypub, models
|
|
|
|
from .abstract_connector import AbstractConnector, SearchResult
|
2020-03-28 19:55:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Connector(AbstractConnector):
|
2020-11-29 02:46:50 +00:00
|
|
|
''' this is basically just for search '''
|
2020-11-25 00:05:00 +00:00
|
|
|
|
2020-11-29 02:46:50 +00:00
|
|
|
def get_or_create_book(self, remote_id):
|
|
|
|
return activitypub.resolve_remote_id(models.Edition, remote_id)
|
2020-05-08 23:56:49 +00:00
|
|
|
|
2020-11-29 02:46:50 +00:00
|
|
|
def parse_search_data(self, data):
|
|
|
|
return data
|
2020-05-04 00:53:14 +00:00
|
|
|
|
2020-11-29 02:46:50 +00:00
|
|
|
def format_search_result(self, search_result):
|
|
|
|
return SearchResult(**search_result)
|
2020-10-31 00:04:10 +00:00
|
|
|
|
2020-11-29 02:46:50 +00:00
|
|
|
def get_remote_id_from_data(self, data):
|
|
|
|
pass
|
2020-10-31 00:04:10 +00:00
|
|
|
|
2020-05-10 19:56:59 +00:00
|
|
|
def is_work_data(self, data):
|
2020-11-29 02:46:50 +00:00
|
|
|
pass
|
2020-03-28 19:55:53 +00:00
|
|
|
|
2020-05-10 19:56:59 +00:00
|
|
|
def get_edition_from_work_data(self, data):
|
2020-11-29 02:46:50 +00:00
|
|
|
pass
|
2020-05-09 00:56:24 +00:00
|
|
|
|
2020-05-10 19:56:59 +00:00
|
|
|
def get_work_from_edition_date(self, data):
|
2020-11-29 02:46:50 +00:00
|
|
|
pass
|
2020-03-28 23:30:54 +00:00
|
|
|
|
2020-05-09 19:09:40 +00:00
|
|
|
def get_cover_from_data(self, data):
|
2020-11-25 00:05:00 +00:00
|
|
|
pass
|
2020-03-28 19:55:53 +00:00
|
|
|
|
2020-05-04 19:36:55 +00:00
|
|
|
def expand_book_data(self, book):
|
2020-11-29 02:46:50 +00:00
|
|
|
pass
|
2020-11-04 21:09:11 +00:00
|
|
|
|
2020-11-29 02:46:50 +00:00
|
|
|
def get_authors_from_data(self, data):
|
|
|
|
pass
|