toggle ascending/descending mode

This commit is contained in:
Raelon Masters
2020-07-06 02:37:35 -04:00
parent 6af7bb459a
commit 4079e04d9b
17 changed files with 147 additions and 211 deletions

View File

@@ -28,6 +28,7 @@ class Catalogue:
self.html_regx = re.compile(r"\.html")
self.title_sanitization_regx = re.compile(r"^(Book )+[0-9]*")
self.title_sanitization_lvl2_regx = re.compile(r"^(Book )+[0-9]*\W+(-)")
self.title_sanitization_dirs_regx = re.compile(r"/")
self.root_dir = config.root
self.book_folder = config.book_path
self.books = None

View File

@@ -1,6 +1,6 @@
#!/usr/bin/python
import re
import datetime
import psycopg2
@@ -53,7 +53,7 @@ class Storage:
Insert book in database
:returns: True if succeeds False if not
"""
q = "INSERT INTO books (title, author, cover, progress, file_name, pages, description, identifier, publisher, 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:
cover_image = book[2].data
@@ -71,7 +71,7 @@ class Storage:
book[4], # descr
book[5], # ident
book[6], # publisher
# book[7], # date # TODO: set import time
datetime.datetime.now(),
book[8], # rights
book[9], # tags
),
@@ -114,6 +114,7 @@ class Storage:
return True
def make_collections(self):
breakpoint()
_title_regx = re.compile(r"^[0-9][0-9]*|-|\ \B")
_q = "SELECT id,file_name FROM books"
self.cursor.execute(_q)