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 %}> <option value="LibraryThing" {% if current == 'LibraryThing' %}selected{% endif %}>
LibraryThing (TSV) LibraryThing (TSV)
</option> </option>
<option value="OpenLibrary" {% if current == 'OpenLibrary' %}selected{% endif %}>
OpenLibrary (CSV)
</option>
</select> </select>
</div> </div>
<div class="field"> <div class="field">

View file

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

View file

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