added audio_track_title filter #98

pull/102/head
meisnate12 4 years ago
parent 97da575aa2
commit fcfc275ce2

@ -562,7 +562,7 @@ class CollectionBuilder:
else: new_dictionary["season"] = data[m]["season"]
new_dictionary["year"] = get_int(method_name, "year", data[m], current_time.year, minimum=1917, maximum=current_time.year + 1)
new_dictionary["limit"] = get_int(method_name, "limit", data[m], 100, maximum=500)
new_dictionary["limit"] = get_int(method_name, "limit", data[m], 0, maximum=500)
self.methods.append((method_name, [new_dictionary]))
else:
raise Failed(f"Collection Error: {m} attribute is not a dictionary: {data[m]}")

@ -326,7 +326,7 @@ class Config:
library = PlexAPI(params, self.TMDb, self.TVDb)
logger.info(f"{params['name']} Library Connection Successful")
except Failed as e:
util.print_multiline(e)
logger.error(e)
logger.info(f"{params['name']} Library Connection Failed")
continue

@ -151,6 +151,18 @@ class PlexAPI:
if (modifier == ".not" and movie.original_language in filter_data) or (modifier != ".not" and movie.original_language not in filter_data):
match = False
break
elif method == "audio_track_title":
for media in current.media:
for part in media.parts:
for audio in part.audioStreams():
for check_title in filter_data:
if (modifier == ".not" and check_title.lower() in audio.title.lower()) or (modifier != ".not" and check_title.lower() not in audio.title.lower()):
match = False
break
if match is False: break
if match is False: break
if match is False: break
if match is False: break
elif modifier in [".gte", ".lte"]:
if method == "vote_count":
tmdb_item = None
@ -174,10 +186,10 @@ class PlexAPI:
attrs = []
if method in ["video_resolution", "audio_language", "subtitle_language"]:
for media in current.media:
if method == "video_resolution": attrs = [media.videoResolution]
if method == "video_resolution": attrs.extend([media.videoResolution])
for part in media.parts:
if method == "audio_language": attrs = ([a.language for a in part.audioStreams()])
if method == "subtitle_language": attrs = ([s.language for s in part.subtitleStreams()])
if method == "audio_language": attrs.extend([a.language for a in part.audioStreams()])
if method == "subtitle_language": attrs.extend([s.language for s in part.subtitleStreams()])
elif method in ["contentRating", "studio", "year", "rating", "originallyAvailableAt"]: attrs = [str(getattr(current, method))]
elif method in ["actors", "countries", "directors", "genres", "writers", "collections"]: attrs = [getattr(x, "tag") for x in getattr(current, method)]

@ -453,6 +453,7 @@ tmdb_type = {
all_filters = [
"actor", "actor.not",
"audio_language", "audio_language.not",
"audio_track_title", "audio_track_title.not",
"collection", "collection.not",
"content_rating", "content_rating.not",
"country", "country.not",
@ -472,6 +473,7 @@ all_filters = [
]
movie_only_filters = [
"audio_language", "audio_language.not",
"audio_track_title", "audio_track_title.not",
"country", "country.not",
"director", "director.not",
"duration.gte", "duration.lte",

Loading…
Cancel
Save