Add support for book 'deletion' (i.e archiving) from a Kobo device.

This commit is contained in:
Michael Shavit
2020-01-24 00:04:16 -05:00
parent cd9bb56db5
commit e404da4192
2 changed files with 50 additions and 4 deletions

View File

@@ -300,6 +300,15 @@ class Bookmark(Base):
format = Column(String(collation='NOCASE'))
bookmark_key = Column(String)
# Baseclass representing books that are archived on the user's Kobo device.
class ArchivedBook(Base):
__tablename__ = 'archived_book'
id = Column(Integer, primary_key=True)
user_id = Column(Integer, ForeignKey('user.id'))
book_id = Column(Integer)
is_archived = Column(Boolean, unique=False)
# Baseclass representing Downloads from calibre-web in app.db
class Downloads(Base):
@@ -353,6 +362,8 @@ def migrate_Database(session):
ReadBook.__table__.create(bind=engine)
if not engine.dialect.has_table(engine.connect(), "bookmark"):
Bookmark.__table__.create(bind=engine)
if not engine.dialect.has_table(engine.connect(), "archived_book"):
ArchivedBook.__table__.create(bind=engine)
if not engine.dialect.has_table(engine.connect(), "registration"):
ReadBook.__table__.create(bind=engine)
conn = engine.connect()