Add openlibrary selector to list

This commit is contained in:
Mouse Reeve 2021-12-14 12:59:24 -08:00
parent ba390dc3ad
commit 73ea44e532
3 changed files with 16 additions and 0 deletions

View file

@ -31,6 +31,9 @@
<option value="LibraryThing" {% if current == 'LibraryThing' %}selected{% endif %}>
LibraryThing (TSV)
</option>
<option value="OpenLibrary" {% if current == 'OpenLibrary' %}selected{% endif %}>
OpenLibrary (CSV)
</option>
</select>
</div>
<div class="field">

View file

@ -105,6 +105,11 @@
<th>
{% trans "ISBN" %}
</th>
{% if job.source == "OpenLibrary" %}
<th>
{% trans "Openlibrary key" %}
</th>
{% endif %}
<th>
{% trans "Author" %}
</th>
@ -145,6 +150,11 @@
<td>
{{ item.isbn|default:'' }}
</td>
{% if job.source == "OpenLibrary" %}
<td>
{{ item.openlibrary_key }}
</td>
{% endif %}
<td>
{{ item.normalized_data.authors }}
</td>

View file

@ -14,6 +14,7 @@ from bookwyrm.importers import (
LibrarythingImporter,
GoodreadsImporter,
StorygraphImporter,
OpenLibraryImporter,
)
# pylint: disable= no-self-use
@ -49,6 +50,8 @@ class Import(View):
importer = LibrarythingImporter()
elif source == "Storygraph":
importer = StorygraphImporter()
elif source == "OpenLibrary":
importer = OpenLibraryImporter()
else:
# Default : Goodreads
importer = GoodreadsImporter()