diff --git a/TODO b/TODO index 3a7f7d7..16de618 100644 --- a/TODO +++ b/TODO @@ -67,6 +67,7 @@ TODO If there are files open and the database is deleted, TypeErrors result Cover culling does not occur if some other tab has initial focus Exiting with Ctrl + Q does not save the cursor position INITIALLY + Slider position change might be acting up too Secondary: pdf support diff --git a/ePub/read_epub.py b/ePub/read_epub.py index 1d51b91..710d82a 100644 --- a/ePub/read_epub.py +++ b/ePub/read_epub.py @@ -17,7 +17,6 @@ # along with this program. If not, see . import os -import sys import zipfile from urllib.parse import unquote @@ -57,7 +56,8 @@ class EPUB: try: this_xml = self.zip_file.read(filename).decode() except KeyError: - print(str(filename) + ' not found in zip') + short_filename = os.path.basename(self.filename) + print(f'{str(filename)} not found in {short_filename}') return root = BeautifulSoup(this_xml, parser) @@ -170,7 +170,7 @@ class EPUB: self.get_file_path(cover_href)) if not self.book['cover']: - # If no cover is located the conventioanl way, + # If no cover is located the conventional way, # we go looking for the largest image in the book biggest_image_size = 0 biggest_image = None diff --git a/lector/__main__.py b/lector/__main__.py index 2cb2498..d209b53 100755 --- a/lector/__main__.py +++ b/lector/__main__.py @@ -195,6 +195,7 @@ class MainUI(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow): # The library refresh button on the Library tab self.reloadLibrary.setIcon(QtGui.QIcon.fromTheme('reload')) self.reloadLibrary.setObjectName('reloadLibrary') + self.reloadLibrary.setToolTip('Scan library') self.reloadLibrary.setAutoRaise(True) self.reloadLibrary.clicked.connect(self.settingsDialog.start_library_scan) @@ -364,6 +365,9 @@ class MainUI(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow): {'Hash': ''}, 'LIKE') + if not all_covers_db: + return + all_covers = { i[0]: i[1] for i in all_covers_db} diff --git a/lector/widgets.py b/lector/widgets.py index 9dc7d6a..5087e55 100644 --- a/lector/widgets.py +++ b/lector/widgets.py @@ -152,8 +152,11 @@ class Tab(QtWidgets.QWidget): self.metadata['hash'], 1, QtCore.Qt.MatchExactly) - self.window().lib_ref.view_model.setData( - matching_item[0], self.metadata['last_accessed'], QtCore.Qt.UserRole + 12) + try: + self.window().lib_ref.view_model.setData( + matching_item[0], self.metadata['last_accessed'], QtCore.Qt.UserRole + 12) + except IndexError: # The file has been deleted + pass def set_scroll_value(self, switch_widgets=True, search_data=None): # TODO