diff --git a/lector/library.py b/lector/library.py index 224cc0a..37993df 100644 --- a/lector/library.py +++ b/lector/library.py @@ -251,12 +251,14 @@ def generate_library_tags(self): db_library_directories = database.DatabaseFunctions( self.parent.database_path).fetch_data( ('Path',), - 'books', # This checks the directories table NOT the book one + 'books', # THIS CHECKS THE BOOKS TABLE {'Path': ''}, 'LIKE') - library_directories = { - i[0]: (None, None) for i in db_library_directories} + library_directories = None + if db_library_directories: + library_directories = { + i[0]: (None, None) for i in db_library_directories} def get_tags(all_metadata): path = os.path.dirname(all_metadata['path']) @@ -282,6 +284,7 @@ def get_tags(all_metadata): return added_string.lower(), None # Generate tags for the QStandardItemModel + # This isn't triggered for an empty view model for i in range(self.view_model.rowCount()): this_item = self.view_model.item(i, 0) all_metadata = this_item.data(QtCore.Qt.UserRole + 3) diff --git a/lector/settings.py b/lector/settings.py index 9600fa2..dd9f158 100644 --- a/lector/settings.py +++ b/lector/settings.py @@ -53,7 +53,7 @@ def read_settings(self): self.parent.settings['current_view'] = int(self.settings.value('currentView', 0)) self.parent.settings['main_window_headers'] = self.settings.value('tableHeaders', None) self.parent.settings['listview_background'] = self.settings.value( - 'listViewBackground', QtGui.QColor().fromRgb(76, 76, 76)) + 'listViewBackground', QtGui.QColor().fromRgb(33, 33, 33)) self.parent.settings['icon_theme'] = self.settings.value('iconTheme', 'DarkIcons') self.settings.endGroup()