From 86e6144e7fcf90021d3f700a6bc907251fd1d3af Mon Sep 17 00:00:00 2001 From: Feramance Date: Fri, 27 Oct 2023 13:41:37 +0200 Subject: [PATCH] [build] Testing search issue --- qBitrr/arss.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/qBitrr/arss.py b/qBitrr/arss.py index befef5e1..1830dfc3 100755 --- a/qBitrr/arss.py +++ b/qBitrr/arss.py @@ -1201,6 +1201,12 @@ def db_reset__movie_searched_state(self): Ids = [id.Id for id in self.model_arr_file.select().execute()] self.model_file.delete().where(self.model_file.EntryId.not_in(Ids)).execute() + def db_reset_arr_search_commands(self): + self.model_arr_command.delete().where( + self.model_arr_command.EndedAt.is_null(True) + & self.model_arr_command.Name.endswith("Search") + ).execute() + def db_get_files_series( self, ) -> Iterable[tuple[SeriesFilesModel, bool, bool]]: @@ -3737,6 +3743,7 @@ def run_search_loop(self) -> NoReturn: loop_timer = timedelta(minutes=15) timer = datetime.now() years_index = 0 + self.db_reset_arr_search_commands() while True: if self.loop_completed: years_index = 0 @@ -3783,9 +3790,7 @@ def run_search_loop(self) -> NoReturn: time.sleep(30) except RestartLoopException: self.loop_completed = True - self.logger.info( - "Loop timer elapsed and search commands completed, restarting it." - ) + self.logger.info("Loop timer elapsed, restarting it.") except NoConnectionrException as e: self.logger.error(e.message) self.manager.qbit_manager.should_delay_torrent_scan = True