Skip to content

Commit

Permalink
Moved Logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed May 29, 2024
1 parent 1ff88ec commit 7dd7eea
Showing 1 changed file with 35 additions and 48 deletions.
83 changes: 35 additions & 48 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -2116,34 +2116,8 @@ def db_update_single_series(
)["customFormatScore"]
else:
customFormat = 0
if (
self.use_temp_for_missing
and db_entry["qualityProfileId"]
== self.temp_quality_profile_id
):
data: JsonObject = {
"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 (
self.use_temp_for_missing
and db_entry["qualityProfileId"]
== self.main_quality_profile_id
):
data: JsonObject = {
"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 @@ -2181,6 +2155,25 @@ def db_update_single_series(
self.model_queue.EntryId == episode["id"]
).execute()

if self.use_temp_for_missing:
if (
searched
and db_entry["qualityProfileId"] == self.temp_quality_profile_id
):
data: JsonObject = {"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
):
data: JsonObject = {"qualityProfileId": self.temp_quality_profile_id}
self.logger.debug(
"Updating quality profile to %s", self.temp_quality_profile_id
)
self.client.upd_episode(episode["id"], data)

if episode["monitored"] == True:
EntryId = episode["id"]

Expand Down Expand Up @@ -2429,30 +2422,8 @@ def db_update_single_series(
)["customFormatScore"]
else:
customFormat = 0
if (
self.use_temp_for_missing
and db_entry["qualityProfileId"]
== self.temp_quality_profile_id
):
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 (
self.use_temp_for_missing
and db_entry["qualityProfileId"]
== self.main_quality_profile_id
):
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 @@ -2488,6 +2459,22 @@ def db_update_single_series(
self.model_queue.EntryId == db_entry["id"]
).execute()

if self.use_temp_for_missing:
if searched 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_movie(db_entry)

if self.minimum_availability_check(db_entry) and db_entry["monitored"] == True:
title = db_entry["title"]
monitored = db_entry["monitored"]
Expand Down

0 comments on commit 7dd7eea

Please sign in to comment.