Skip to content

Commit

Permalink
Malformed disk image fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Nov 22, 2023
1 parent 3ce9928 commit e211305
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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):
Expand All @@ -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(
Expand Down

0 comments on commit e211305

Please sign in to comment.