Skip to content

Commit

Permalink
Added debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed May 29, 2024
1 parent 41cb3f3 commit 1ff88ec
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ def __init__(
self.use_temp_for_missing = CONFIG.get(
f"{name}.EntrySearch.UseTempForMissing", fallback=False
)
self.main_quality_profile = CONFIG.get(f"{self._name}.EntrySearch.MainQualityProfile")
self.temp_quality_profile = CONFIG.get(f"{self._name}.EntrySearch.TempQualityProfile")
if self.use_temp_for_missing:
(
self.main_quality_profile_id,
Expand Down Expand Up @@ -2123,6 +2125,10 @@ def db_update_single_series(
"qualityProfileId": self.main_quality_profile_id
}
self.client.upd_episode(episode["id"], data)
self.logger.debug(
"Updating quality profile to %s",
self.main_quality_profile_id,
)
else:
customFormat = 0
if (
Expand All @@ -2134,6 +2140,10 @@ def db_update_single_series(
"qualityProfileId": self.temp_quality_profile_id
}
self.client.upd_episode(episode["id"], data)
self.logger.debug(
"Updating quality profile to %s",
self.temp_quality_profile_id,
)
else:
minCustomFormat = self.client.get_quality_profile(
episode["series"]["qualityProfileId"]
Expand Down Expand Up @@ -2341,11 +2351,17 @@ def db_update_single_series(
and db_entry["qualityProfileId"] == self.temp_quality_profile_id
):
db_entry["qualityProfileId"] = self.main_quality_profile_id
self.logger.debug(
"Updating quality profile to %s", self.main_quality_profile_id
)
elif (
not searched
and db_entry["qualityProfileId"] == self.main_quality_profile_id
):
db_entry["qualityProfileId"] = self.temp_quality_profile_id
self.logger.debug(
"Updating quality profile to %s", self.temp_quality_profile_id
)
self.client.upd_series(db_entry)
Title = seriesMetadata.get("title")
Monitored = db_entry["monitored"]
Expand Down Expand Up @@ -2420,6 +2436,10 @@ def db_update_single_series(
):
db_entry["qualityProfileId"] = self.main_quality_profile_id
self.client.upd_movie(db_entry)
self.logger.debug(
"Updating quality profile to %s",
self.main_quality_profile_id,
)
else:
customFormat = 0
if (
Expand All @@ -2429,6 +2449,10 @@ def db_update_single_series(
):
db_entry["qualityProfileId"] = self.temp_quality_profile_id
self.client.upd_movie(db_entry)
self.logger.debug(
"Updating quality profile to %s",
self.temp_quality_profile_id,
)

else:
minCustomFormat = self.client.get_quality_profile(
Expand Down Expand Up @@ -4292,13 +4316,11 @@ def _update_bad_queue_items(self):
def parse_quality_profiles(self) -> tuple[int, int]:
main_quality_profile_id = 0
temp_quality_profile_id = 0
main_quality_profile = CONFIG.get(f"{self._name}.EntrySearch.MainQualityProfile")
temp_quality_profile = CONFIG.get(f"{self._name}.EntrySearch.TempQualityProfile")
profiles = self.client.get_quality_profile()
for p in profiles:
if p["name"] == main_quality_profile:
if p["name"] == self.main_quality_profile:
main_quality_profile_id = p["id"]
if p["name"] == temp_quality_profile:
if p["name"] == self.temp_quality_profile:
temp_quality_profile_id = p["id"]
return (main_quality_profile_id, temp_quality_profile_id)

Expand Down

0 comments on commit 1ff88ec

Please sign in to comment.