mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Reforming data inserts
This commit is contained in:
@@ -175,8 +175,24 @@ class Catalogue:
|
|||||||
cover_image = None
|
cover_image = None
|
||||||
title = book.title().decode("utf-8")
|
title = book.title().decode("utf-8")
|
||||||
author = book.author().decode("utf-8")
|
author = book.author().decode("utf-8")
|
||||||
# TODO some files are still passing encoded data for author.
|
description = None
|
||||||
return [title, author, cover_image, book.f.name]
|
identifier = None
|
||||||
|
publisher = None
|
||||||
|
date = None
|
||||||
|
rights = None
|
||||||
|
ftags = None
|
||||||
|
return [
|
||||||
|
title,
|
||||||
|
author,
|
||||||
|
cover_image,
|
||||||
|
book.f.name,
|
||||||
|
description,
|
||||||
|
identifier,
|
||||||
|
publisher,
|
||||||
|
date,
|
||||||
|
rights,
|
||||||
|
ftags,
|
||||||
|
]
|
||||||
|
|
||||||
def extract_content(self, book_zip, book):
|
def extract_content(self, book_zip, book):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ class Storage:
|
|||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
if int(e.pgcode) == 22007:
|
||||||
|
book[7] = psycopg2.Date(int(book[7]), 1, 1)
|
||||||
|
self.insert_book(book)
|
||||||
print(e)
|
print(e)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user