mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 08:36:32 +00:00
Add Calibre importer for CSV exports
Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
This commit is contained in:
parent
a4a06fa32c
commit
3626db3c1a
4 changed files with 15 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
""" import classes """
|
||||
|
||||
from .importer import Importer
|
||||
from .calibre_import import CalibreImporter
|
||||
from .goodreads_import import GoodreadsImporter
|
||||
from .librarything_import import LibrarythingImporter
|
||||
from .openlibrary_import import OpenLibraryImporter
|
||||
|
|
8
bookwyrm/importers/calibre_import.py
Normal file
8
bookwyrm/importers/calibre_import.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
""" handle reading a csv from calibre """
|
||||
from . import Importer
|
||||
|
||||
|
||||
class CalibreImporter(Importer):
|
||||
"""csv downloads from OpenLibrary"""
|
||||
|
||||
service = "Calibre"
|
|
@ -32,6 +32,9 @@
|
|||
<option value="OpenLibrary" {% if current == 'OpenLibrary' %}selected{% endif %}>
|
||||
OpenLibrary (CSV)
|
||||
</option>
|
||||
<option value="Calibre" {% if current == 'Calibre' %}selected{% endif %}>
|
||||
Calibre (CSV)
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ from django.views import View
|
|||
|
||||
from bookwyrm import forms, models
|
||||
from bookwyrm.importers import (
|
||||
CalibreImporter,
|
||||
LibrarythingImporter,
|
||||
GoodreadsImporter,
|
||||
StorygraphImporter,
|
||||
|
@ -52,6 +53,8 @@ class Import(View):
|
|||
importer = StorygraphImporter()
|
||||
elif source == "OpenLibrary":
|
||||
importer = OpenLibraryImporter()
|
||||
elif source == "Calibre":
|
||||
importer = CalibreImporter()
|
||||
else:
|
||||
# Default : Goodreads
|
||||
importer = GoodreadsImporter()
|
||||
|
|
Loading…
Reference in a new issue