Skip to content

Commit

Permalink
[52] Fix originals_only on Streaming (#2244)
Browse files Browse the repository at this point in the history
  • Loading branch information
YozoraXCII authored and actions-user committed Sep 26, 2024
1 parent 15c7357 commit 3a47379
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ Fixes sort order of resolution collections
Fixes #2228 ".any" not accepted for a variety of imdb_search parameters
Fixes `streaming` defaults adding and removing items randomly
Fixes missing TMDb Discover parameters
Fixes `imdb_chart` error when using `trending_india`
Adds error information to help with #2201
Various other Minor Fixes
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.2-build51
2.0.2-build52
19 changes: 14 additions & 5 deletions defaults/both/streaming.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ templates:
conditionals:
discover_sort:
conditions:
- library_type: movie
- originals_only: false
library_type: movie
value: primary_release_date.desc
- library_type: show
- originals_only: false
library_type: show
value: first_air_date.desc
originals:
conditions:
Expand All @@ -42,6 +44,14 @@ templates:
conditions:
- originals_only: false
value: <<final_tmdb_key>>
discover_limit:
conditions:
- originals_only: false
value: 0
discover_count:
conditions:
- originals_only: false
value: 100
allowed_streaming:
conditions:
- originals_only: true
Expand Down Expand Up @@ -74,13 +84,12 @@ templates:
mdblist_list: https://mdblist.com/lists/k0meta/<<key>>-<<originals>>
limit: <<limit>>
tmdb_discover:
limit: 0
limit: <<discover_limit>>
with_watch_providers: <<discover_with>>
vote_count.gte: 100
vote_count.gte: <<discover_count>>
watch_region: <<discover_region>>
sort_by: <<discover_sort>>


collections:
Streaming Collections:
template:
Expand Down
14 changes: 10 additions & 4 deletions defaults/overlays/streaming.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ templates:
conditionals:
discover_sort:
conditions:
- library_type: movie
- originals_only: false
library_type: movie
value: primary_release_date.desc
- library_type: show
- originals_only: false
library_type: show
value: first_air_date.desc
originals:
conditions:
Expand All @@ -77,7 +79,11 @@ templates:
discover_limit:
conditions:
- originals_only: false
value: <<limit>>
value: 0
discover_count:
conditions:
- originals_only: false
value: 100
discover_with:
conditions:
- originals_only: false
Expand Down Expand Up @@ -110,7 +116,7 @@ templates:
tmdb_discover:
limit: <<discover_limit>>
with_watch_providers: <<discover_with>>
vote_count.gte: 100
vote_count.gte: <<discover_count>>
watch_region: <<discover_region>>
sort_by: <<discover_sort>>

Expand Down
14 changes: 5 additions & 9 deletions modules/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1483,14 +1483,10 @@ def _imdb(self, method_name, method_data):
self.builders.append((method_name, imdb_dict))
elif method_name == "imdb_chart":
for value in util.get_list(method_data):
if value in imdb.movie_charts and not self.library.is_movie:
raise Failed(f"{self.Type} Error: chart: {value} does not work with show libraries")
elif value in imdb.show_charts and self.library.is_movie:
raise Failed(f"{self.Type} Error: chart: {value} does not work with movie libraries")
elif value in imdb.movie_charts or value in imdb.show_charts:
self.builders.append((method_name, value))
else:
raise Failed(f"{self.Type} Error: chart: {value} is invalid options are {[i for i in imdb.charts]}")
_chart = imdb.movie_charts if self.library.is_movie else imdb.show_charts
if value not in _chart:
raise Failed(f"{self.Type} Error: chart: {value} is invalid options are {', '.join(_chart)}")
self.builders.append((method_name, value))
elif method_name == "imdb_award":
for dict_data in util.parse(self.Type, method_name, method_data, datatype="listdict"):
dict_methods = {dm.lower(): dm for dm in dict_data}
Expand Down Expand Up @@ -2010,7 +2006,7 @@ def _tmdb(self, method_name, method_data):
raise Failed(f"{self.Type} Error: {method_name} {discover_method} attribute: must be used with either with_watch_providers, without_watch_providers, or with_watch_monetization_types")
elif discover_attr == "with_watch_monetization_types":
if "watch_region" in dict_data:
new_dictionary[lower_method] = util.parse(self.Type, discover_method, discover_data, parent=method_name, options=tmdb.discover_monetization_types)
new_dictionary[lower_method] = discover_data
else:
raise Failed(f"{self.Type} Error: {method_name} {discover_method} attribute: must be used with watch_region")
elif discover_attr in tmdb.discover_booleans:
Expand Down
5 changes: 3 additions & 2 deletions modules/tmdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
]
discover_strings = [
"with_cast", "with_crew", "with_people", "with_companies", "without_companies", "with_networks", "with_genres",
"without_genres", "with_release_type", "with_keywords", "without_keywords", "with_origin_country", "with_original_language", "timezone",
"with_watch_providers", "without_watch_providers", "with_overview_translation", "with_title_translation", "with_name_translation"
"without_genres", "with_release_type", "with_keywords", "without_keywords", "with_origin_country", "timezone",
"with_watch_providers", "without_watch_providers", "with_overview_translation",
"with_original_language", "with_watch_monetization_types", "with_title_translation", "with_name_translation"
]
discover_ints = ["vote_count", "with_runtime"]
modifiers = [".gte", ".lte"]
Expand Down

0 comments on commit 3a47379

Please sign in to comment.