From e211305183c0237013c099d81da158061af20491 Mon Sep 17 00:00:00 2001 From: Feramance Date: Wed, 22 Nov 2023 14:07:05 +0100 Subject: [PATCH] Malformed disk image fix --- qBitrr/arss.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/qBitrr/arss.py b/qBitrr/arss.py index 13ac0055..56bd3a48 100755 --- a/qBitrr/arss.py +++ b/qBitrr/arss.py @@ -1169,7 +1169,10 @@ def db_reset__series_searched_state(self): self.series_file_model.update(Searched=False, Upgrade=False).where( self.series_file_model.Searched == True ).execute() - Ids = [id.Id for id in self.model_arr_series_file.select().execute()] + try: + Ids = [id.Id for id in self.model_arr_series_file.select().execute()] + except peewee.DatabaseError: + self.logger.error("Database disk image malformed") self.series_file_model.delete().where( self.series_file_model.EntryId.not_in(Ids) ).execute() @@ -1182,7 +1185,10 @@ def db_reset__episode_searched_state(self): self.model_file.update(Searched=False, Upgrade=False).where( self.model_file.Searched == True ).execute() - Ids = [id.Id for id in self.model_arr_file.select().execute()] + try: + Ids = [id.Id for id in self.model_arr_file.select().execute()] + except peewee.DatabaseError: + self.logger.error("Database disk image malformed") self.model_file.delete().where(self.model_file.EntryId.not_in(Ids)).execute() def db_reset__movie_searched_state(self): @@ -1193,7 +1199,10 @@ def db_reset__movie_searched_state(self): self.model_file.update(Searched=False, Upgrade=False).where( self.model_file.Searched == True ).execute() - Ids = [id.Id for id in self.model_arr_file.select().execute()] + try: + Ids = [id.Id for id in self.model_arr_file.select().execute()] + except peewee.DatabaseError: + self.logger.error("Database disk image malformed") self.model_file.delete().where(self.model_file.EntryId.not_in(Ids)).execute() def db_get_files_series(