Implemented the return of unique files for storage

This commit is contained in:
Raelon Masters
2019-10-14 17:52:16 -04:00
parent a1bb0aa101
commit f821eb02cb
15 changed files with 87 additions and 76 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/python
import sys
import sqlite3
sys.path.insert(1,'../')
# sys.path.insert(1, '../')
from config import Config
db_pointer = Config().catalogue_db
@@ -55,6 +55,13 @@ class Storage:
print(e)
return False
def book_paths_list(self):
q = '''SELECT file_name FROM books'''
x = self.cursor.execute(q)
try: x = x.fetchall()
except Exception: x = []
return x
def commit(self):
try: self.db.commit(); return True
except Exception as e: return False
except Exception as e: return False