def start_deletion(self, clearIndex: bool): MiscUtils.debug_this_thread() with IndexDB() as indexDB: if clearIndex: indexDB.clear_indexed_files() self.__logger.info("Index cleared") settings: Settings = indexDB.get_settings() MiscUtils.recursively_delete_children(settings.output_dir) MiscUtils.recursively_delete_children(settings.unknown_output_dir) self.__logger.info("Output directories cleared")
def __queue_poll_thread_target(self, progress_signal): MiscUtils.debug_this_thread() self.__logger.info("Queue poll thread started") log_formatter = MiscUtils.get_default_log_formatter() while not self.__cleanup_started: log_record = self.__log_window_queue.get() if log_record is None: break if self.__window.isVisible(): log_text = log_formatter.format(log_record) progress_signal.emit(log_text)
def start_indexing(self): MiscUtils.debug_this_thread() with IndexDB() as indexDB: indexing_task = IndexingTask() indexing_task.settings = indexDB.get_settings() if self.settings_valid(indexing_task.settings): misc_utils = MiscUtils(indexing_task) misc_utils.create_root_marker() indexing_helper = IndexingHelper(indexing_task, self.log_queue, self.indexing_stop_event) (scanned_files, _) = indexing_helper.scan_dirs() indexing_helper.remove_slate_files(indexDB, scanned_files) indexing_helper.lookup_already_indexed_files( indexDB, scanned_files) if not self.indexing_stop_event.is_set(): indexing_helper.create_media_files(scanned_files) if not self.indexing_stop_event.is_set(): media_processor = MediaProcessor(indexing_task, self.log_queue, self.indexing_stop_event) media_processor.save_processed_files(indexDB) if not self.indexing_stop_event.is_set(): misc_utils.cleanEmptyOutputDirs()
def auto_update_check(self): MiscUtils.debug_this_thread() self.check_for_updates(False)