Skip to content

Commit

Permalink
Further testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Dec 10, 2024
1 parent 0029967 commit b024cf3
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -2370,24 +2370,21 @@ def db_update_single_series(
self.model_file.SeriesTitle: SeriesTitle,
self.model_file.SeasonNumber: SeasonNumber,
self.model_file.QualityMet: QualityMet,
self.model_file.Upgrade: False,
self.model_file.Searched: searched,
self.model_file.MinCustomFormatScore: minCustomFormat,
self.model_file.CustomFormatScore: customFormat,
self.model_file.CustomFormatMet: customFormatMet,
self.model_file.Reason: reason,
}
if searched:
to_update[self.model_file.Searched] = searched

upgrade = False
to_update[self.model_file.Upgrade] = upgrade

self.logger.debug(
"Updating database entry | %s | S%02dE%03d [Searched:%s][Upgrade:%s][QualityMet:%s][CustomFormatMet:%s]",
SeriesTitle.ljust(60, "."),
SeasonNumber,
EpisodeNumber,
str(searched).ljust(5),
str(upgrade).ljust(5),
str(False).ljust(5),
str(QualityMet).ljust(5),
str(customFormatMet).ljust(5),
)
Expand All @@ -2410,7 +2407,7 @@ def db_update_single_series(
Searched=searched,
IsRequest=request,
QualityMet=QualityMet,
Upgrade=upgrade,
Upgrade=False,
MinCustomFormatScore=minCustomFormat,
CustomFormatScore=customFormat,
CustomFormatMet=customFormatMet,
Expand Down Expand Up @@ -2539,28 +2536,24 @@ def db_update_single_series(
to_update = {
self.series_file_model.Monitored: Monitored,
self.series_file_model.Title: Title,
self.series_file_model.Searched: searched,
self.series_file_model.Upgrade: False,
self.series_file_model.MinCustomFormatScore: minCustomFormat,
}

if searched:
to_update[self.series_file_model.Searched] = searched

upgrade = False
to_update[self.series_file_model.Upgrade] = upgrade

self.logger.debug(
"Updating database entry | %s [Searched:%s][Upgrade:%s]",
Title.ljust(60, "."),
str(searched).ljust(5),
str(upgrade).ljust(5),
str(False).ljust(5),
)

db_commands = self.series_file_model.insert(
EntryId=EntryId,
Title=Title,
Searched=searched,
Monitored=Monitored,
Upgrade=upgrade,
Upgrade=False,
MinCustomFormatScore=minCustomFormat,
).on_conflict(
conflict_target=[self.series_file_model.EntryId], update=to_update
Expand Down Expand Up @@ -2713,26 +2706,22 @@ def db_update_single_series(
self.model_file.MovieFileId: movieFileId,
self.model_file.Monitored: monitored,
self.model_file.QualityMet: qualityMet,
self.model_file.Searched: searched,
self.model_file.Upgrade: False,
self.model_file.MinCustomFormatScore: minCustomFormat,
self.model_file.CustomFormatScore: customFormat,
self.model_file.CustomFormatMet: customFormatMet,
self.model_file.Reason: reason,
}

if searched:
to_update[self.model_file.Searched] = searched

upgrade = False
to_update[self.model_file.Upgrade] = upgrade

if request:
to_update[self.model_file.IsRequest] = request

self.logger.debug(
"Updating database entry | %s [Searched:%s][Upgrade:%s][QualityMet:%s][CustomFormatMet:%s]",
title.ljust(60, "."),
str(searched).ljust(5),
str(upgrade).ljust(5),
str(False).ljust(5),
str(qualityMet).ljust(5),
str(customFormatMet).ljust(5),
)
Expand All @@ -2747,7 +2736,7 @@ def db_update_single_series(
MovieFileId=movieFileId,
IsRequest=request,
QualityMet=qualityMet,
Upgrade=upgrade,
Upgrade=False,
MinCustomFormatScore=minCustomFormat,
CustomFormatScore=customFormat,
CustomFormatMet=customFormatMet,
Expand Down Expand Up @@ -4826,6 +4815,7 @@ def run_search_loop(self) -> NoReturn:
series_search,
commands,
) in self.db_get_files():
self.logger.trace("Grabbed %s items", totcommands)
if totcommands == -1:
totcommands = commands
self.logger.info("Starting search for %s items", totcommands)
Expand Down

0 comments on commit b024cf3

Please sign in to comment.