mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-22 12:33:10 +00:00
fix for #126
This commit is contained in:
parent
bddaa35733
commit
91f6503b22
3 changed files with 11 additions and 1 deletions
|
@ -470,7 +470,7 @@ class CollectionBuilder:
|
||||||
elif attr in ["include_adult", "include_null_first_air_dates", "screened_theatrically"]:
|
elif attr in ["include_adult", "include_null_first_air_dates", "screened_theatrically"]:
|
||||||
if attr_data is True:
|
if attr_data is True:
|
||||||
new_dictionary[attr] = attr_data
|
new_dictionary[attr] = attr_data
|
||||||
elif attr in ["primary_release_date.gte", "primary_release_date.lte", "release_date.gte", "release_date.lte", "air_date.gte", "air_date.lte", "first_air_date.gte", "first_air_date.lte"]:
|
elif attr in util.discover_dates:
|
||||||
new_dictionary[attr] = util.check_date(attr_data, f"{m} attribute {attr}", return_string=True)
|
new_dictionary[attr] = util.check_date(attr_data, f"{m} attribute {attr}", return_string=True)
|
||||||
elif attr in ["primary_release_year", "year", "first_air_date_year"]:
|
elif attr in ["primary_release_year", "year", "first_air_date_year"]:
|
||||||
new_dictionary[attr] = util.check_number(attr_data, f"{m} attribute {attr}", minimum=1800, maximum=current_year + 1)
|
new_dictionary[attr] = util.check_number(attr_data, f"{m} attribute {attr}", minimum=1800, maximum=current_year + 1)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import logging, tmdbv3api
|
import logging, tmdbv3api
|
||||||
|
from datetime import datetime
|
||||||
from modules import util
|
from modules import util
|
||||||
from modules.util import Failed
|
from modules.util import Failed
|
||||||
from retrying import retry
|
from retrying import retry
|
||||||
|
@ -155,6 +156,9 @@ class TMDbAPI:
|
||||||
def get_discover(self, attrs, amount, is_movie):
|
def get_discover(self, attrs, amount, is_movie):
|
||||||
ids = []
|
ids = []
|
||||||
count = 0
|
count = 0
|
||||||
|
for date_attr in util.discover_dates:
|
||||||
|
if date_attr in attrs:
|
||||||
|
attrs[date_attr] = datetime.strftime(datetime.strptime(attrs[date_attr], "%m/%d/%Y"), "%Y-%m-%d")
|
||||||
self.Discover.discover_movies(attrs) if is_movie else self.Discover.discover_tv_shows(attrs)
|
self.Discover.discover_movies(attrs) if is_movie else self.Discover.discover_tv_shows(attrs)
|
||||||
total_pages = int(self.TMDb.total_pages)
|
total_pages = int(self.TMDb.total_pages)
|
||||||
total_results = int(self.TMDb.total_results)
|
total_results = int(self.TMDb.total_results)
|
||||||
|
|
|
@ -516,6 +516,12 @@ discover_tv = [
|
||||||
"include_null_first_air_dates",
|
"include_null_first_air_dates",
|
||||||
"screened_theatrically"
|
"screened_theatrically"
|
||||||
]
|
]
|
||||||
|
discover_dates = [
|
||||||
|
"primary_release_date.gte", "primary_release_date.lte",
|
||||||
|
"release_date.gte", "release_date.lte",
|
||||||
|
"air_date.gte", "air_date.lte",
|
||||||
|
"first_air_date.gte", "first_air_date.lte"
|
||||||
|
]
|
||||||
discover_movie_sort = [
|
discover_movie_sort = [
|
||||||
"popularity.asc", "popularity.desc",
|
"popularity.asc", "popularity.desc",
|
||||||
"release_date.asc", "release_date.desc",
|
"release_date.asc", "release_date.desc",
|
||||||
|
|
Loading…
Reference in a new issue