Skip to content

Commit

Permalink
[patch] fixed date issue with minimum availabilty conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Aug 17, 2023
1 parent aa18ade commit 01cf104
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,14 @@ def _db_request_update(self, request_ids: dict[str, set[int | str]]):
self.model_arr_movies_file: MoviesMetadataModel
condition = self.model_arr_movies_file.Year <= datetime.now().year
condition &= self.model_arr_movies_file.Year > 0
condition &= self.model_arr_file.MinimumAvailability == self.minimum_availability
if self.minimum_availability == 2:
condition &= self.model_arr_movies_file.InCinemas <= datetime.now()
elif self.minimum_availability == 3:
condition &= (
self.model_arr_movies_file.DigitalRelease
<= datetime.now() | self.model_arr_movies_file.PhysicalRelease
<= datetime.now()
)
tmdb_con = None
imdb_con = None
if ImdbIds := request_ids.get("ImdbId"):
Expand Down
2 changes: 1 addition & 1 deletion qBitrr/gen_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def _gen_default_search_table(category: str, cat_default: Table):
search_table.add(nl())
search_table.add(
comment(
"Choose Minimum Availability for Radarr Instances. (Cinema=1, Digital=2, Physical=3)"
"Choose Minimum Availability for Radarr Instances. (Announced=1, In Cinemas=2, Released=3)"
)
)
search_table.add("MinimumAvailability", 3)
Expand Down

0 comments on commit 01cf104

Please sign in to comment.