Skip to content

Dry up rendering of book provider download options to only use one download options html #11274

@cdrini

Description

@cdrini

Currently we have a separate download option for each trusted book provider:

  • openlibrary/templates/book_providers/librivox_download_options.html
  • openlibrary/templates/book_providers/ia_download_options.html
  • openlibrary/templates/book_providers/openstax_download_options.html
  • and so on

Now that we have normalized AbstractBookProvider.get_acquisitions, we want to replace these with book_providers/download_options.html template, that simple renders the relevant acquisitions.

def get_acquisitions(
self,
ed_or_solr: Edition | dict,
) -> list[Acquisition]:
if providers := ed_or_solr.get('providers', []):
return [Acquisition.from_json(dict(p)) for p in providers]
else:
return []

Metadata

Metadata

Assignees

Labels

Lead: @cdriniIssues overseen by Drini (Staff: Team Lead & Solr, Library Explorer, i18n) [managed]Needs: Review AssigneeIssues that may have been abandoned by assigneesPriority: 3Issues that we can consider at our leisure. [managed]Theme: Trusted Book ProvidersType: Refactor/Clean-upIssues related to reorganization/clean-up of data or code (e.g. for maintainability). [managed]

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions