forked from mirrors/bookwyrm
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 """
|
""" import classes """
|
||||||
|
|
||||||
from .importer import Importer
|
from .importer import Importer
|
||||||
|
from .calibre_import import CalibreImporter
|
||||||
from .goodreads_import import GoodreadsImporter
|
from .goodreads_import import GoodreadsImporter
|
||||||
from .librarything_import import LibrarythingImporter
|
from .librarything_import import LibrarythingImporter
|
||||||
from .openlibrary_import import OpenLibraryImporter
|
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 %}>
|
<option value="OpenLibrary" {% if current == 'OpenLibrary' %}selected{% endif %}>
|
||||||
OpenLibrary (CSV)
|
OpenLibrary (CSV)
|
||||||
</option>
|
</option>
|
||||||
|
<option value="Calibre" {% if current == 'Calibre' %}selected{% endif %}>
|
||||||
|
Calibre (CSV)
|
||||||
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ from django.views import View
|
||||||
|
|
||||||
from bookwyrm import forms, models
|
from bookwyrm import forms, models
|
||||||
from bookwyrm.importers import (
|
from bookwyrm.importers import (
|
||||||
|
CalibreImporter,
|
||||||
LibrarythingImporter,
|
LibrarythingImporter,
|
||||||
GoodreadsImporter,
|
GoodreadsImporter,
|
||||||
StorygraphImporter,
|
StorygraphImporter,
|
||||||
|
@ -52,6 +53,8 @@ class Import(View):
|
||||||
importer = StorygraphImporter()
|
importer = StorygraphImporter()
|
||||||
elif source == "OpenLibrary":
|
elif source == "OpenLibrary":
|
||||||
importer = OpenLibraryImporter()
|
importer = OpenLibraryImporter()
|
||||||
|
elif source == "Calibre":
|
||||||
|
importer = CalibreImporter()
|
||||||
else:
|
else:
|
||||||
# Default : Goodreads
|
# Default : Goodreads
|
||||||
importer = GoodreadsImporter()
|
importer = GoodreadsImporter()
|
||||||
|
|
Loading…
Reference in a new issue