Skip to content

Commit

Permalink
Multiple temp profiles changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Dec 4, 2024
1 parent 0b88fcf commit ec9338c
Showing 1 changed file with 34 additions and 15 deletions.
49 changes: 34 additions & 15 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -2305,21 +2305,27 @@ def db_update_single_series(
in self.temp_quality_profile_ids.values()
):
data: JsonObject = {
"qualityProfileId": self.temp_quality_profile_ids[
db_entry["qualityProfileId"]
"qualityProfileId": list(
self.temp_quality_profile_ids.keys()
)[
list(self.temp_quality_profile_ids.values()).index(
db_entry["qualityProfileId"]
)
]
}
self.logger.debug(
"Updating quality profile for %s to %s",
db_entry["title"],
self.temp_quality_profile_ids[
db_entry["qualityProfileId"]
list(self.temp_quality_profile_ids.keys())[
list(self.temp_quality_profile_ids.values()).index(
db_entry["qualityProfileId"]
)
],
)
elif (
not searched
and db_entry["qualityProfileId"]
in self.temp_quality_profile_ids.values()
in self.temp_quality_profile_ids.keys()
):
data: JsonObject = {
"qualityProfileId": self.temp_quality_profile_ids[
Expand Down Expand Up @@ -2521,20 +2527,26 @@ def db_update_single_series(
and db_entry["qualityProfileId"]
in self.temp_quality_profile_ids.values()
):
db_entry["qualityProfileId"] = self.temp_quality_profile_ids[
db_entry["qualityProfileId"]
db_entry["qualityProfileId"] = list(
self.temp_quality_profile_ids.keys()
)[
list(self.temp_quality_profile_ids.values()).index(
db_entry["qualityProfileId"]
)
]
self.logger.debug(
"Updating quality profile for %s to %s",
db_entry["title"],
self.temp_quality_profile_ids[
db_entry["qualityProfileId"]
list(self.temp_quality_profile_ids.keys())[
list(self.temp_quality_profile_ids.values()).index(
db_entry["qualityProfileId"]
)
],
)
elif (
not searched
and db_entry["qualityProfileId"]
in self.temp_quality_profile_ids.values()
in self.temp_quality_profile_ids.keys()
):
db_entry["qualityProfileId"] = self.temp_quality_profile_ids[
db_entry["qualityProfileId"]
Expand Down Expand Up @@ -2684,18 +2696,26 @@ def db_update_single_series(
and db_entry["qualityProfileId"]
in self.temp_quality_profile_ids.values()
):
db_entry["qualityProfileId"] = self.temp_quality_profile_ids[
db_entry["qualityProfileId"]
db_entry["qualityProfileId"] = list(
self.temp_quality_profile_ids.keys()
)[
list(self.temp_quality_profile_ids.values()).index(
db_entry["qualityProfileId"]
)
]
self.logger.debug(
"Updating quality profile for %s to %s",
db_entry["title"],
self.temp_quality_profile_ids[db_entry["qualityProfileId"]],
list(self.temp_quality_profile_ids.keys())[
list(self.temp_quality_profile_ids.values()).index(
db_entry["qualityProfileId"]
)
],
)
elif (
not searched
and db_entry["qualityProfileId"]
in self.temp_quality_profile_ids.values()
in self.temp_quality_profile_ids.keys()
):
db_entry["qualityProfileId"] = self.temp_quality_profile_ids[
db_entry["qualityProfileId"]
Expand Down Expand Up @@ -4604,7 +4624,6 @@ def parse_quality_profiles(self) -> dict[int, int]:
pair[1] = p["id"]
self.logger.trace("Quality profile %s:%s", p["name"], p["id"])
temp_quality_profile_ids[pair[0]] = pair[1]
temp_quality_profile_ids[pair[1]] = pair[0]

return temp_quality_profile_ids

Expand Down

0 comments on commit ec9338c

Please sign in to comment.