mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Merge pull request #36 from th3r00t/0.5.0-collections
Time to merge the collections branch.
This commit is contained in:
2
config.json
vendored
2
config.json
vendored
@@ -1 +1 @@
|
||||
{"TITLE": "pyShelf E-Book Server", "VERSION": "0.5.0", "BOOKPATH": "/home/raelon/Books", "DB_HOST": "localhost", "DB_PORT": "5432", "DATABASE": "pyshelf", "USER": "pyshelf", "PASSWORD": "pyshelf", "BOOKSHELF": "data/shelf.json", "ALLOWED_HOSTS": "*", "hostname": "localhost", "webport": "8000", "wsgiport": "8001"}
|
||||
{"TITLE": "pyShelf E-Book Server", "VERSION": "0.5.0", "BOOKPATH": "", "DB_HOST": "localhost", "DB_PORT": "5432", "DATABASE": "pyshelf", "USER": "pyshelf", "PASSWORD": "pyshelf", "BOOKSHELF": "data/shelf.json", "ALLOWED_HOSTS": "*", "hostname": "localhost", "webport": "8000", "wsgiport": "8001"}
|
||||
|
||||
@@ -112,9 +112,9 @@ class Storage:
|
||||
_s = _p.replace("'", "")
|
||||
_x = re.sub(_title_regx, "", _s)
|
||||
_s = _x.strip()
|
||||
breakpoint()
|
||||
_q_x = """
|
||||
SELECT id FROM collections where collection='%s' AND book_id_id=%s
|
||||
SELECT id FROM collections where collection='%s'\
|
||||
AND book_id_id=%s
|
||||
""" % (
|
||||
_s,
|
||||
book[0],
|
||||
@@ -123,7 +123,8 @@ class Storage:
|
||||
self.cursor.execute(_q_x)
|
||||
if len(self.cursor.fetchall()) < 1:
|
||||
self.cursor.execute(
|
||||
"""INSERT INTO collections (collection, book_id_id) VALUES ('%s',%s)"""
|
||||
"""INSERT INTO collections\
|
||||
(collection, book_id_id) VALUES ('%s',%s)"""
|
||||
% (_s, book[0])
|
||||
)
|
||||
except Exception as e:
|
||||
|
||||
@@ -206,7 +206,6 @@ def menu(which, _set=1):
|
||||
x = x + 1
|
||||
else:
|
||||
x = 0
|
||||
breakpoint()
|
||||
# TODO trim #'s and symbols from front of collection name
|
||||
if len(i.collection) > 16:
|
||||
collection_string = i.collection[0:16] + " ..."
|
||||
|
||||
Reference in New Issue
Block a user