diff --git a/docs/files/builders/tmdb.md b/docs/files/builders/tmdb.md index b00725911..3818c1b17 100644 --- a/docs/files/builders/tmdb.md +++ b/docs/files/builders/tmdb.md @@ -468,15 +468,14 @@ and in a specific order. !!!bug - We have noticed inconsistent responses from TMDb when using `desc`as the sort order. This can result in movies/shows disappearing from and reapparing in collections/overlays sporadically. **We suggest users do not use the popularity.desc sort options with `tmdb_discover`**. + We have noticed inconsistent responses from TMDb when using `popularity.asc` and `popularity.desc` as the sort order. This can result in movies/shows disappearing from and reapparing in collections/overlays sporadically. **We suggest users do not use the popularity sort options with `tmdb_discover`**. This bug is on TMDb's side and we are awaiting a fix from them. | Movie Parameters | Description | |:--------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `limit` | Specify how many movies you want returned by the query.
**Type:** Integer
**Default:** 100 | -| `language` | ISO-639-1 or ISO-3166-1 value to display translated data for the fields that support it.
**Type:** String
**Default:** en-US | -| `region` | Specify a [ISO 3166-1 code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) to filter release dates. Must be uppercase. Will use the `region` specified in the [TMDb Config](../../config/tmdb.md) by default.
**Type:** `^[A-Z]{2}$` | +| `region` | Specify a [ISO 3166-1 code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) to filter release dates. Must be uppercase. Will use the `region` specified in the [TMDb Config](../../config/tmdb.md) by default.
**Type:** `^[A-Z]{2}$` | | `sort_by` | Choose from one of the many available sort options.
**Type:** Any [sort options](#sort-options) below
**Default:** `popularity.desc` | | `certification_country` | Used in conjunction with the certification parameter, use this to specify a country with a valid certification.
**Type:** String | | `certification` | Filter results with a valid certification from the `certification_country` parameter.
**Type:** String | @@ -495,23 +494,23 @@ and in a specific order. | `vote_count.lte` | Filter and only include movies that have a vote count that is less than or equal to the specified value.
**Type:** Integer | | `vote_average.gte` | Filter and only include movies that have a rating that is greater or equal to the specified value.
**Type:** Number | | `vote_average.lte` | Filter and only include movies that have a rating that is less than or equal to the specified value.
**Type:** Number | -| `with_cast` | A comma-separated list of person ID's. Only include movies that have one of the ID's added as an actor.
Can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String | -| `with_crew` | A comma-separated list of person ID's. Only include movies that have one of the ID's added as a crew member.
Can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String | -| `with_people` | A comma-separated list of person ID's. Only include movies that have one of the ID's added as either an actor or a crew member.
Can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String | -| `with_companies` | A comma-separated list of production company ID's. Only include movies that have one of the ID's added as a production company.
Can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String | +| `with_cast` | A comma-separated list of person ID's. Only include movies that have one of the ID's added as an actor.
Can be a comma (`,`) for an AND, or a pipe (`|`) for an OR separated query
**Type:** String | +| `with_crew` | A comma-separated list of person ID's. Only include movies that have one of the ID's added as a crew member.
Can be a comma (`,`) for an AND, or a pipe (`|`) for an OR separated query
**Type:** String | +| `with_people` | A comma-separated list of person ID's. Only include movies that have one of the ID's added as either an actor or a crew member.
Can be a comma (`,`) for an AND, or a pipe (`|`) for an OR separated query
**Type:** String | +| `with_companies` | A comma-separated list of production company ID's. Only include movies that have one of the ID's added as a production company.
Can be a comma (`,`) for an AND, or a pipe (`|`) for an OR separated query
**Type:** String | | `without_companies` | Filter the results to exclude the specific production companies you specify here. AND / OR filters are supported.
**Type:** String | -| `with_genres` | Comma-separated value of genre ids that you want to include in the results.
Can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String | +| `with_genres` | Comma-separated value of genre ids that you want to include in the results.
Can be a comma (`,`) for an AND, or a pipe (`|`) for an OR separated query
**Type:** String | | `without_genres` | Comma-separated value of genre ids that you want to exclude from the results.
**Type:** String | -| `with_keywords` | A comma-separated list of keyword ID's. Only includes movies that have one of the ID's added as a keyword.
Can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String | +| `with_keywords` | A comma-separated list of keyword ID's. Only includes movies that have one of the ID's added as a keyword.
Can be a comma (`,`) for an AND, or a pipe (`|`) for an OR separated query
**Type:** String | | `without_keywords` | Exclude items with certain keywords. You can comma and pipe separate these values to create an 'AND' or 'OR' logic.
**Type:** String | | `with_runtime.gte` | Filter and only include movies that have a runtime that is greater or equal to a value.
**Type:** Integer | | `with_runtime.lte` | Filter and only include movies that have a runtime that is less than or equal to a value.
**Type:** Integer | -| `with_origin_country` | Specify an ISO 639-1 string to filter and only include movies that have the given origin country.
**Type:** String | +| `with_origin_country` | Specify an origin country string to filter results by their original country value.
**Type:** String | | `with_original_language` | Specify an ISO 639-1 string to filter results by their original language value.
**Type:** String | -| `with_watch_providers` | A comma or pipe separated list of watch provider ID's.
use in conjunction with watch_region, can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String | -| `without_watch_providers` | A comma or pipe separated list of watch provider ID's to exclude.
use in conjunction with watch_region, can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String | +| `with_watch_providers` | A comma or pipe separated list of watch provider ID's.
use in conjunction with watch_region, can be a comma (`,`) for an AND, or a pipe (`|`) for an OR separated query
**Type:** String | +| `without_watch_providers` | Filter the results to exclude certain watch providers.
**Type:** String | | `watch_region` | An [ISO 3166-1 code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). Combine this filter with `with_watch_providers` in order to filter your results by a specific watch provider in a specific region.
**Type:** String
**Values:** [ISO 3166-1 code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) | -| `with_watch_monetization_types` | In combination with `watch_region`, you can filter by monetization type.
Can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String
**Values:** `flatrate`, `free`, `ads`, `rent`, `buy` | +| `with_watch_monetization_types` | In combination with `watch_region`, you can filter by monetization type.
Can be a comma (`,`) for an AND, or a pipe (`|`) for an OR separated query
**Type:** String
**Values:** `flatrate`, `free`, `ads`, `rent`, `buy` | ### Discover Shows Parameters @@ -523,53 +522,52 @@ and in a specific order. !!!bug - We have noticed inconsistent responses from TMDb when using `desc`as the sort order. This can result in movies/shows disappearing from and reapparing in collections/overlays sporadically. **We suggest users do not use the popularity.desc sort options with `tmdb_discover`**. + We have noticed inconsistent responses from TMDb when using `popularity.desc` as the sort order. This can result in movies disappearing from and reapparing in collections/overlays sporadically. **We suggest users do not use the popularity.desc sort options with `tmdb_discover`**. This bug is on TMDb's side and we are awaiting a fix from them. | Show Parameters | Description | |:--------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `limit` | Specify how many movies you want to be returned by the query.
**Type:** Integer
**Default:** 100 | -| `language` | ISO-639-1 or ISO-3166-1 value to display translated data for the fields that support it.
**Type:** String
**Default:** en-US | -| `region` | Specify a [ISO 3166-1 code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) to filter release dates. Must be uppercase. Will use the `region` specified in the [TMDb Config](../../config/tmdb.md) by default.
**Type:** `^[A-Z]{2}$` | | `sort_by` | Choose from one of the many available sort options.
**Type:** Any [sort options](#sort-options) below
**Default:** `popularity.desc` | | `air_date.gte` | Filter and only include TV shows that have an air date (by looking at all episodes) that is greater or equal to the specified value.
**Type:** Date: `MM/DD/YYYY` | | `air_date.lte` | Filter and only include TV shows that have an air date (by looking at all episodes) that is less than or equal to the specified value.
**Type:** Date: `MM/DD/YYYY` | | `first_air_date.gte` | Filter and only include TV shows that have a original air date that is greater or equal to the specified value. Can be used in conjunction with the `include_null_first_air_dates` filter if you want to include items with no air date.
**Type:** Date: `MM/DD/YYYY` | | `first_air_date.lte` | Filter and only include TV shows that have a original air date that is less than or equal to the specified value. Can be used in conjunction with the `include_null_first_air_dates` filter if you want to include items with no air date.
**Type:** Date: `MM/DD/YYYY` | | `first_air_date_year` | Filter and only include TV shows that have an original air date year that equal to the specified value. Can be used in conjunction with the `include_null_first_air_dates` filter if you want to include items with no air date.
**Type:** Year: `YYYY` | -| `include_null_first_air_dates` | Use this filter to include TV shows that don't have an air date while using any of the `first_air_date` filters.
**Type:** Boolean | | `include_adult` | A filter and include or exclude adult movies.
**Type:** Boolean | +| `include_null_first_air_dates` | Use this filter to include TV shows that don't have an air date while using any of the `first_air_date` filters.
**Type:** Boolean | | `timezone` | Used in conjunction with the `air_date.gte/lte` filter to calculate the proper UTC offset.
**Type:** String
**Default:** `America/New_York` | | `vote_count.gte` | Filter and only include TV that have a vote count that is greater or equal to the specified value.
**Type:** Integer | | `vote_count.lte` | Filter and only include TV that have a vote count that is less than or equal to the specified value.
**Type:** Integer | | `vote_average.gte` | Filter and only include TV that have a rating that is greater or equal to the specified value.
**Type:** Number | | `vote_average.lte` | Filter and only include TV that have a rating that is less than or equal to the specified value.
**Type:** Number | | `with_networks` | Comma-separated value of network ids that you want to include in the results.
**Type:** String | -| `with_companies` | A comma-separated list of production company ID's. Only include movies that have one of the ID's added as a production company.
Can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String | +| `with_companies` | A comma-separated list of production company ID's. Only include movies that have one of the ID's added as a production company.
Can be a comma (`,`) for an AND, or a pipe (`|`) for an OR separated query
**Type:** String | | `without_companies` | Filter the results to exclude the specific production companies you specify here. AND / OR filters are supported.
**Type:** String | -| `with_genres` | Comma-separated value of genre ids that you want to include in the results.
Can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String | +| `with_genres` | Comma-separated value of genre ids that you want to include in the results.
Can be a comma (`,`) for an AND, or a pipe (`|`) for an OR separated query
**Type:** String | | `without_genres` | Comma-separated value of genre ids that you want to exclude from the results.
**Type:** String | -| `with_keywords` | A comma-separated list of keyword ID's. Only includes TV shows that have one of the ID's added as a keyword.
Can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String | +| `with_keywords` | A comma-separated list of keyword ID's. Only includes TV shows that have one of the ID's added as a keyword.
Can be a comma (`,`) for an AND, or a pipe (`|`) for an OR separated query
**Type:** String | | `without_keywords` | Exclude items with certain keywords. You can comma and pipe separate these values to create an 'AND' or 'OR' logic.
**Type:** String | | `with_runtime.gte` | Filter and only include TV shows with an episode runtime that is greater than or equal to a value.
**Type:** Integer | | `with_runtime.lte` | Filter and only include TV shows with an episode runtime that is less than or equal to a value.
**Type:** Integer | | `with_original_language` | Specify an ISO 639-1 string to filter results by their original language value.
**Type:** String | +| `with_name_translation` | Specify a language/country string to filter the results by if the item has a type of name translation.
**Type:** String
**Values:** `ar-AE`, `ar-SA`, `bg-BG`, `bn-BD`, `ca-ES`, `ch-GU`, `cs-CZ`, `da-DK`, `de-DE`, `el-GR`, `en-US`, `eo-EO`, `es-ES`, `es-MX`, `eu-ES`, `fa-IR`, `fi-FI`, `fr-CA`, `fr-FR`, `he-IL`, `hi-IN`, `hu-HU`, `id-ID`, `it-IT`, `ja-JP`, `ka-GE`, `kn-IN`, `ko-KR`, `lt-LT`, `ml-IN`, `nb-NO`, `nl-NL`, `no-NO`, `pl-PL`, `pt-BR`, `pt-PT`, `ro-RO`, `ru-RU`, `sk-SK`, `sl-SI`, `sr-RS`, `sv-SE`, `ta-IN`, `te-IN`, `th-TH`, `tr-TR`, `uk-UA`, `vi-VN`, `zh-CN`, `zh-TW` | | `screened_theatrically` | Filter results to include items that have been screened theatrically.
**Type:** Boolean | -| `with_watch_providers` | A comma or pipe separated list of watch provider ID's.
use in conjunction with watch_region, can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String | -| `without_watch_providers` | A comma or pipe separated list of watch provider ID's to exclude.
use in conjunction with watch_region, can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String | +| `with_watch_providers` | A comma or pipe separated list of watch provider ID's.
use in conjunction with watch_region, can be a comma (`,`) for an AND, or a pipe (`|`) for an OR separated query
**Type:** String | +| `without_watch_providers` | Filter the results to exclude certain watch providers.
**Type:** String | | `watch_region` | An [ISO 3166-1 code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). Combine this filter with `with_watch_providers` in order to filter your results by a specific watch provider in a specific region.
**Type:** String | -| `with_watch_monetization_types` | In combination with `watch_region`, you can filter by monetization type.
Can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String
**Values:** `flatrate`, `free`, `ads`, `rent`, `buy` | -| `with_status` | Filter TV shows by their status.
**Type:** String
Can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Values:** `0`: Returning Series, `1`: Planned, `2`: In Production, `3`: Ended, `4`: Cancelled, `5`: Pilot | -| `with_type` | Filter TV shows by their type.
Can be a comma (`,`) for an AND, or a pipe (` |`) for an OR separated query
**Type:** String
**Values:** `0`: Documentary, `1`: News, `2`: Miniseries, `3`: Reality, `4`: Scripted, `5`: Show, `6`: Video | +| `with_watch_monetization_types` | In combination with `watch_region`, you can filter by monetization type.
Can be a comma (`,`) for an AND, or a pipe (`|`) for an OR separated query
**Type:** String
**Values:** `flatrate`, `free`, `ads`, `rent`, `buy` | +| `with_status` | Filter TV shows by their status.
**Type:** String
Can be a comma (`,`) for an AND, or a pipe (`|`) for an OR separated query
**Values:** `0`: Returning Series, `1`: Planned, `2`: In Production, `3`: Ended, `4`: Cancelled, `5`: Pilot | +| `with_type` | Filter TV shows by their type.
Can be a comma (`,`) for an AND, or a pipe (`|`) for an OR separated query
**Type:** String
**Values:** `0`: Documentary, `1`: News, `2`: Miniseries, `3`: Reality, `4`: Scripted, `5`: Show, `6`: Video | ### Sort Options !!!bug - We have noticed inconsistent responses from TMDb when using `desc`as the sort order. This can result in movies/shows disappearing from and reapparing in collections/overlays sporadically. + We have noticed inconsistent responses from TMDb when using `popularity.desc` as the sort order. This can result in shows disappearing from and reapparing in collections/overlays sporadically. - **Due to the nature of this bug, we suggest you do not use the popularity.desc sort options with `tmdb_discover` unless you also set a `limit` of 20 or less**. If you do not set a limit, the data that TMDb returns may be inconsistent.** + **Due to the nature of this bug, we suggest you do not use the `popularity.desc` sort options with `tmdb_discover` unless you also set a `limit` of 20 or less**. If you do not set a limit, the data that TMDb returns may be inconsistent.** This bug is on TMDb's side that we have made them aware of and are currently awaiting a fix. @@ -578,8 +576,14 @@ and in a specific order. |:----------------------------|:------------------------------------------:|:------------------------------------------:| | `popularity.asc` | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | | `popularity.desc` | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | +| `title.asc` | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | +| `title.desc` | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | | `original_title.asc` | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | | `original_title.desc` | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | +| `name.asc` | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } | +| `name.desc` | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } | +| `original_name.asc` | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } | +| `original_name.desc` | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } | | `revenue.asc` | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | | `revenue.desc` | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | | `release_date.asc` | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | @@ -590,8 +594,8 @@ and in a specific order. | `first_air_date.desc` | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } | | `vote_average.asc` | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | | `vote_average.desc` | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | -| `vote_count.asc` | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | -| `vote_count.desc` | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | +| `vote_count.asc` | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | +| `vote_count.desc` | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | ```yaml collections: diff --git a/modules/builder.py b/modules/builder.py index 7b5291fa6..a4ea7b68e 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -10,6 +10,7 @@ from plexapi.audio import Artist, Album, Track from plexapi.exceptions import NotFound from plexapi.video import Movie, Show, Season, Episode +from tmdbapis.tmdb import discover_movie_sort_options, discover_tv_sort_options logger = util.logger @@ -1975,7 +1976,7 @@ def _tmdb(self, method_name, method_data): if method_name == "tmdb_discover": for dict_data in util.parse(self.Type, method_name, method_data, datatype="listdict"): dict_methods = {dm.lower(): dm for dm in dict_data} - new_dictionary = {"limit": util.parse(self.Type, "limit", dict_data, datatype="int", methods=dict_methods, default=100, parent=method_name)} + new_dictionary = {"limit": util.parse(self.Type, "limit", dict_data, datatype="int", methods=dict_methods, minimum=0, default=100, parent=method_name)} for discover_method, discover_data in dict_data.items(): lower_method = str(discover_method).lower() discover_attr, modifier = os.path.splitext(lower_method) @@ -1990,7 +1991,7 @@ def _tmdb(self, method_name, method_data): elif discover_attr == "region": new_dictionary[discover_attr] = util.parse(self.Type, discover_method, discover_data.upper(), parent=method_name, regex=("^[A-Z]{2}$", "US")) elif discover_attr == "sort_by": - options = tmdb.discover_movie_sort if self.library.is_movie else tmdb.discover_tv_sort + options = discover_movie_sort_options if self.library.is_movie else discover_tv_sort_options new_dictionary[lower_method] = util.parse(self.Type, discover_method, discover_data, parent=method_name, options=options) elif discover_attr == "certification_country": if "certification" in dict_data or "certification.lte" in dict_data or "certification.gte" in dict_data: diff --git a/modules/tmdb.py b/modules/tmdb.py index 66c5ace7a..c108e04b6 100644 --- a/modules/tmdb.py +++ b/modules/tmdb.py @@ -27,7 +27,7 @@ } discover_movie_only = [ "region", "with_cast", "with_crew", "with_people", "certification_country", "certification", "include_video", "year", - "primary_release_year", "primary_release_date", "release_date", "include_adult", "with_release_type", "with_title_translation" + "primary_release_year", "primary_release_date", "release_date", "with_release_type", "with_title_translation", "with_origin_country" ] discover_tv_only = [ "timezone", "screened_theatrically", "include_null_first_air_dates", "air_date", "first_air_date", @@ -35,7 +35,7 @@ ] 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_original_language", "timezone", + "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" ] discover_ints = ["vote_count", "with_runtime"] @@ -52,12 +52,6 @@ discover_all = discover_special + discover_strings + discover_years + discover_booleans + date_methods + \ [f"{f}{m}" for f in discover_ints for m in modifiers] + \ [f"{f}{m}" for f in discover_numbers for m in modifiers] -discover_movie_sort = [ - "popularity.asc", "popularity.desc", "release_date.asc", "release_date.desc", "revenue.asc", "revenue.desc", - "primary_release_date.asc", "primary_release_date.desc", "original_title.asc", "original_title.desc", - "vote_average.asc", "vote_average.desc", "vote_count.asc", "vote_count.desc" -] -discover_tv_sort = ["vote_average.desc", "vote_average.asc", "first_air_date.desc", "first_air_date.asc", "popularity.desc", "popularity.asc"] discover_monetization_types = ["flatrate", "free", "ads", "rent", "buy"] discover_types = { "Documentary": "documentary", "News": "news", "Miniseries": "miniseries", diff --git a/requirements.txt b/requirements.txt index 8ad9e231a..946bb1b90 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,4 +13,4 @@ tenacity==9.0.0 ruamel.yaml==0.18.6 schedule==1.2.2 setuptools==75.1.0 -tmdbapis==1.2.18 \ No newline at end of file +tmdbapis==1.2.19 \ No newline at end of file