Update readme
Begin logging Account for fb2 books without covers
This commit is contained in:
@@ -17,9 +17,12 @@
|
||||
import os
|
||||
import pickle
|
||||
import sqlite3
|
||||
import logging
|
||||
|
||||
from PyQt5 import QtCore
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class DatabaseInit:
|
||||
def __init__(self, location_prefix):
|
||||
@@ -81,7 +84,8 @@ class DatabaseInit:
|
||||
for i in self.books_table_columns.items():
|
||||
if i[0] not in database_columns:
|
||||
commit_required = True
|
||||
print(f'Database: Adding column "{i[0]}"')
|
||||
info_string = f'Database: Adding column "{i[0]}"'
|
||||
logger.info(info_string)
|
||||
sql_command = f"ALTER TABLE books ADD COLUMN {i[0]} {i[1]}"
|
||||
self.database.execute(sql_command)
|
||||
|
||||
@@ -208,7 +212,7 @@ class DatabaseFunctions:
|
||||
return None
|
||||
|
||||
except (KeyError, sqlite3.OperationalError):
|
||||
print('SQLite is in wretched rebellion @ data fetching handling')
|
||||
logger.critical('SQLite is in wretched rebellion @ data fetching handling')
|
||||
|
||||
def fetch_covers_only(self, hash_list):
|
||||
parameter_marks = ','.join(['?' for i in hash_list])
|
||||
@@ -241,7 +245,7 @@ class DatabaseFunctions:
|
||||
self.database.execute(
|
||||
sql_command, update_data)
|
||||
except sqlite3.OperationalError:
|
||||
print('SQLite is in wretched rebellion @ metadata handling')
|
||||
logger.critical('SQLite is in wretched rebellion @ metadata handling')
|
||||
|
||||
self.database.commit()
|
||||
self.database.close()
|
||||
|
Reference in New Issue
Block a user