moviewyrm/bookwyrm/connectors/bookwyrm_connector.py
Mouse Reeve ac261d7b1a Send connector with search result
also fix typo in get_work_from_edition_data function
2020-12-27 14:33:34 -08:00

17 lines
585 B
Python

''' using another bookwyrm instance as a source of book data '''
from bookwyrm import activitypub, models
from .abstract_connector import AbstractMinimalConnector, SearchResult
class Connector(AbstractMinimalConnector):
''' this is basically just for search '''
def get_or_create_book(self, remote_id):
return activitypub.resolve_remote_id(models.Edition, remote_id)
def parse_search_data(self, data):
return data
def format_search_result(self, search_result):
search_result['connector'] = self
return SearchResult(**search_result)