Skip to content

Commit

Permalink
[build] More debugs and potential fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Aug 30, 2023
1 parent d4a0ca8 commit 93ff82e
Showing 1 changed file with 43 additions and 15 deletions.
58 changes: 43 additions & 15 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -1297,21 +1297,37 @@ def _db_request_update(self, request_ids: dict[str, set[int | str]]):
condition &= tmdb_con
elif imdb_con:
condition &= imdb_con
for db_entry in (
self.model_arr_file.select()
.join(
self.model_arr_movies_file,
on=(
self.model_arr_file.MovieMetadataId
== self.model_arr_movies_file.Id
),
join_type=JOIN.LEFT_OUTER,
)
.switch(self.model_arr_file)
.where(condition)
.order_by(self.model_arr_file.Added.desc())
):
self.db_update_single_series(db_entry=db_entry, request=True)
entries = (
self.model_arr_file.select()
.join(
self.model_arr_movies_file,
on=(
self.model_arr_file.MovieMetadataId
== self.model_arr_movies_file.Id
),
join_type=JOIN.LEFT_OUTER,
)
.switch(self.model_arr_file)
.where(condition)
.order_by(self.model_arr_file.Added.desc())
.count()
)
self.logger.debug("DB Request Update %s entries", entries)
for db_entry in (
self.model_arr_file.select()
.join(
self.model_arr_movies_file,
on=(
self.model_arr_file.MovieMetadataId
== self.model_arr_movies_file.Id
),
join_type=JOIN.LEFT_OUTER,
)
.switch(self.model_arr_file)
.where(condition)
.order_by(self.model_arr_file.Added.desc())
):
self.db_update_single_series(db_entry=db_entry, request=True)
except requests.exceptions.ConnectionError:
self.logger.error("Connection Error")
raise DelayLoopException(length=300, type=self._name)
Expand Down Expand Up @@ -1399,6 +1415,18 @@ def db_update(self):
):
self.db_update_single_series(db_entry=series, series=True)
elif self.type == "radarr":
entries = (
self.model_arr_file.select(self.model_arr_file)
.join(
self.model_arr_movies_file,
on=(self.model_arr_file.MovieMetadataId == self.model_arr_movies_file.Id),
)
.switch(self.model_arr_file)
.where(self.model_arr_movies_file.Year == self.search_current_year)
.order_by(self.model_arr_file.Added.desc())
.count()
)
self.logger.debug("DB Request Update %s entries", entries)
for movies in (
self.model_arr_file.select(self.model_arr_file)
.join(
Expand Down

0 comments on commit 93ff82e

Please sign in to comment.