Finished extra data processing for epubs

This commit is contained in:
Raelon Masters
2020-06-14 21:31:12 -04:00
parent e3ea56c216
commit be5ac2d94f
2 changed files with 11 additions and 10 deletions

View File

@@ -53,7 +53,7 @@ class Storage:
Insert book in database Insert book in database
:returns: True if succeeds False if not :returns: True if succeeds False if not
""" """
q = "INSERT INTO books (title, author, cover, progress, file_name, pages, description, publisher, date, rights, tags) values (%s, %s, %s, 0, %s, 0, %s, %s, %s, %s, %s);" q = "INSERT INTO books (title, author, cover, progress, file_name, pages, description, identifier, publisher, date, rights, tags) values (%s, %s, %s, 0, %s, 0, %s, %s, %s, %s, %s, %s);"
try: try:
try: try:
cover_image = book[2].data cover_image = book[2].data
@@ -64,16 +64,16 @@ class Storage:
self.cursor.execute( self.cursor.execute(
q, q,
( (
book[0], book[0], # title
book[1], book[1], # author
cover_image, cover_image,
book[3], book[3], # file
book[4], book[4], # descr
book[5], book[5], # ident
book[6], book[6], # publisher
book[7], book[7], # date
book[8], book[8], # rights
book[9], book[9], # tags
), ),
) )
return True return True

View File

@@ -30,6 +30,7 @@ class Books(models.Model):
progress = models.IntegerField(null=True) progress = models.IntegerField(null=True)
file_name = models.CharField(max_length=255, null=False) file_name = models.CharField(max_length=255, null=False)
description = models.TextField(null=True) description = models.TextField(null=True)
identifier = models.CharField(max_length=255, null=True)
publisher = models.CharField(max_length=266, null=True) publisher = models.CharField(max_length=266, null=True)
date = models.DateField(null=True) date = models.DateField(null=True)
rights = models.CharField(max_length=255, null=True) rights = models.CharField(max_length=255, null=True)