Fix file duplication
Increase icon size for scan library icon
This commit is contained in:
@@ -189,6 +189,7 @@ class MainUI(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow):
|
||||
|
||||
# The library refresh button on the Library tab
|
||||
self.reloadLibrary.setIcon(self.QImageFactory.get_image('reload'))
|
||||
self.reloadLibrary.setIconSize(QtCore.QSize(22, 22))
|
||||
self.reloadLibrary.setObjectName('reloadLibrary')
|
||||
self.reloadLibrary.setToolTip('Scan library')
|
||||
self.reloadLibrary.setAutoRaise(True)
|
||||
@@ -287,6 +288,9 @@ class MainUI(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow):
|
||||
self.temp_dir.path())
|
||||
|
||||
parsed_books = books.initiate_threads()
|
||||
if not parsed_books:
|
||||
return
|
||||
|
||||
database.DatabaseFunctions(self.database_path).add_to_database(parsed_books)
|
||||
self.lib_ref.generate_model('addition', parsed_books, True)
|
||||
|
||||
|
@@ -149,7 +149,9 @@ class BookSorter:
|
||||
# Do not allow addition in case the file
|
||||
# is already in the database and it remains at its original path
|
||||
if self.mode == 'addition' and file_md5 in self.hashes_and_paths:
|
||||
if self.hashes_and_paths[file_md5] == filename:
|
||||
if (self.hashes_and_paths[file_md5] == filename
|
||||
and os.path.exists(self.hashes_and_paths[file_md5])):
|
||||
print(f'{os.path.basename(filename)} is already in database')
|
||||
return
|
||||
|
||||
file_extension = os.path.splitext(filename)[1][1:]
|
||||
@@ -247,6 +249,9 @@ class BookSorter:
|
||||
break
|
||||
|
||||
def initiate_threads(self):
|
||||
if not self.file_list:
|
||||
return None
|
||||
|
||||
def pool_creator():
|
||||
_pool = Pool(5)
|
||||
self.processed_books = _pool.map(
|
||||
|
@@ -58,7 +58,11 @@ class BackGroundBookAddition(QtCore.QThread):
|
||||
self.database_path,
|
||||
self.parent.settings['auto_tags'],
|
||||
self.parent.temp_dir.path())
|
||||
|
||||
parsed_books = books.initiate_threads()
|
||||
if not parsed_books:
|
||||
return
|
||||
|
||||
self.parent.lib_ref.generate_model('addition', parsed_books, False)
|
||||
if self.prune_required:
|
||||
self.parent.lib_ref.prune_models(self.file_list)
|
||||
|
@@ -237,14 +237,6 @@ class Tab(QtWidgets.QWidget):
|
||||
self.exit_fs.setContext(QtCore.Qt.ApplicationShortcut)
|
||||
self.exit_fs.activated.connect(self.exit_fullscreen)
|
||||
|
||||
# TODO
|
||||
# See why Ctrl + Q won't work on a non fullscreened contentView
|
||||
# widget in case the following is in code
|
||||
|
||||
# self.exit_all = QtWidgets.QShortcut(
|
||||
# QtGui.QKeySequence('Ctrl+Q'), self.contentView)
|
||||
# self.exit_all.activated.connect(self.sneaky_exit)
|
||||
|
||||
def go_fullscreen(self):
|
||||
if self.contentView.windowState() == QtCore.Qt.WindowFullScreen:
|
||||
self.exit_fullscreen()
|
||||
|
Reference in New Issue
Block a user