mirror of
https://github.com/mza921/Plex-Auto-Collections
synced 2024-11-14 16:27:22 +00:00
Upped to 2.6.0
This commit is contained in:
parent
bbe7238471
commit
5875a76a14
4 changed files with 38 additions and 34 deletions
|
@ -4,14 +4,16 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [2.6.0] - 2020-11-## - [#76](https://github.com/mza921/Plex-Auto-Collections/pull/76)
|
||||
## [2.6.0] - 2020-11-12 - [#113](https://github.com/mza921/Plex-Auto-Collections/pull/113)
|
||||
### Added
|
||||
- [#107](https://github.com/mza921/Plex-Auto-Collections/issues/107) - Added `plex_collection`
|
||||
- [#86](https://github.com/mza921/Plex-Auto-Collections/issues/86) - Added `tmdb_company` and `tmdb_network`
|
||||
- [#41](https://github.com/mza921/Plex-Auto-Collections/issues/41) - Added `tmdb_discover`
|
||||
|
||||
### Changed
|
||||
- Added `tmdb_popular`, `tmdb_top_rated`, `tmdb_now_playing`
|
||||
|
||||
### Fixed
|
||||
- [#108](https://github.com/mza921/Plex-Auto-Collections/issues/108) - Fixed TMDb error
|
||||
- [#102](https://github.com/mza921/Plex-Auto-Collections/issues/102) - If any APIs are invalid the collection switches to append
|
||||
|
||||
## [2.5.0] - 2020-11-11 - [#112](https://github.com/mza921/Plex-Auto-Collections/pull/112)
|
||||
### Added
|
||||
|
|
|
@ -307,10 +307,13 @@ def update_from_config(config_path, plex, headless=False, no_meta=False, no_imag
|
|||
for m in collections[c]:
|
||||
if ("tmdb" in m or "imdb" in m) and not TMDB.valid:
|
||||
print("| Config Error: {} skipped. tmdb incorrectly configured".format(m))
|
||||
map = {}
|
||||
elif ("trakt" in m or (("tmdb" in m or "tvdb" in m) and plex.library_type == "show")) and not TraktClient.valid:
|
||||
print("| Config Error: {} skipped. trakt incorrectly configured".format(m))
|
||||
map = {}
|
||||
elif m == "tautulli" and not Tautulli.valid:
|
||||
print("| Config Error: {} skipped. tautulli incorrectly configured".format(m))
|
||||
map = {}
|
||||
elif collections[c][m]:
|
||||
if m in alias:
|
||||
method_name = alias[m]
|
||||
|
@ -959,7 +962,7 @@ print("| | _/| |/ -_)\ \ / / _ \| || || _|/ _ \ | (__ / _ \| || |/ -_)/ _|
|
|||
print("| |_| |_|\___|/_\_\ /_/ \_\\\\_,_| \__|\___/ \___|\___/|_||_|\___|\__| \__||_|\___/|_||_|/__/ |")
|
||||
print("| |")
|
||||
print("|===================================================================================================|")
|
||||
print("| Version 2.5.0")
|
||||
print("| Version 2.6.0")
|
||||
print("| Locating config...")
|
||||
config_path = None
|
||||
app_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
|
|
|
@ -149,12 +149,8 @@ def add_to_collection(config_path, plex, method, value, c, map, filters=None):
|
|||
movies, missing = imdb_tools.imdb_get_movies(config_path, plex, value)
|
||||
elif "tmdb" in method:
|
||||
movies, missing = imdb_tools.tmdb_get_movies(config_path, plex, value, method)
|
||||
elif method == "trakt_list":
|
||||
movies, missing = trakt_tools.trakt_get_movies(config_path, plex, value)
|
||||
elif method == "trakt_trending":
|
||||
movies, missing = trakt_tools.trakt_get_movies(config_path, plex, value, list_type='trending')
|
||||
elif method == "trakt_watchlist":
|
||||
movies, missing = trakt_tools.trakt_get_movies(config_path, plex, value, list_type='watchlist')
|
||||
elif "trakt" in method:
|
||||
movies, missing = trakt_tools.trakt_get_movies(config_path, plex, value, method)
|
||||
elif method == "tautulli":
|
||||
movies, missing = imdb_tools.get_tautulli(config_path, plex, value)
|
||||
elif method == "all":
|
||||
|
@ -170,12 +166,8 @@ def add_to_collection(config_path, plex, method, value, c, map, filters=None):
|
|||
shows, missing = imdb_tools.tmdb_get_shows(config_path, plex, value, method)
|
||||
elif method == "tvdb_show":
|
||||
shows, missing = imdb_tools.tvdb_get_shows(config_path, plex, value)
|
||||
elif method == "trakt_list":
|
||||
shows, missing = trakt_tools.trakt_get_shows(config_path, plex, value)
|
||||
elif method == "trakt_trending":
|
||||
shows, missing = trakt_tools.trakt_get_shows(config_path, plex, value, list_type='trending')
|
||||
elif method == "trakt_watchlist":
|
||||
shows, missing = trakt_tools.trakt_get_shows(config_path, plex, value, list_type='watchlist')
|
||||
elif "trakt" in method:
|
||||
shows, missing = trakt_tools.trakt_get_shows(config_path, plex, value, method)
|
||||
elif method == "tautulli":
|
||||
shows, missing = imdb_tools.get_tautulli(config_path, plex, value)
|
||||
elif method == "all":
|
||||
|
|
|
@ -4,23 +4,30 @@ import plex_tools
|
|||
import trakt
|
||||
import os
|
||||
|
||||
def trakt_get_movies(config_path, plex, data, list_type='userlist'):
|
||||
elif method == "trakt_list":
|
||||
movies, missing = trakt_tools.trakt_get_movies(config_path, plex, value)
|
||||
elif method == "trakt_trending":
|
||||
movies, missing = trakt_tools.trakt_get_movies(config_path, plex, value, list_type='trending')
|
||||
elif method == "trakt_watchlist":
|
||||
movies, missing = trakt_tools.trakt_get_movies(config_path, plex, value, list_type='watchlist')
|
||||
|
||||
def trakt_get_movies(config_path, plex, data, method):
|
||||
config_tools.TraktClient(config_path)
|
||||
if list_type == 'userlist':
|
||||
trakt_url = data
|
||||
if trakt_url[-1:] == " ":
|
||||
trakt_url = trakt_url[:-1]
|
||||
trakt_list_path = urlparse(trakt_url).path
|
||||
trakt_list_items = trakt.Trakt[trakt_list_path].items()
|
||||
elif list_type == 'trending':
|
||||
if method == "trakt_trending":
|
||||
max_items = int(data)
|
||||
trakt_list_items = trakt.Trakt['movies'].trending(per_page=max_items)
|
||||
elif list_type == 'watchlist':
|
||||
elif method == "trakt_watchlist":
|
||||
trakt_url = data
|
||||
if trakt_url[-1:] == " ":
|
||||
trakt_url = trakt_url[:-1]
|
||||
trakt_list_path = 'users/{}/watchlist'.format(data)
|
||||
trakt_list_items = [movie for movie in trakt.Trakt[trakt_list_path].movies()]
|
||||
else:
|
||||
trakt_url = data
|
||||
if trakt_url[-1:] == " ":
|
||||
trakt_url = trakt_url[:-1]
|
||||
trakt_list_path = urlparse(trakt_url).path
|
||||
trakt_list_items = trakt.Trakt[trakt_list_path].items()
|
||||
title_ids = [m.pk[1] for m in trakt_list_items if isinstance(m, trakt.objects.movie.Movie)]
|
||||
|
||||
imdb_map = {}
|
||||
|
@ -68,23 +75,23 @@ def trakt_get_movies(config_path, plex, data, list_type='userlist'):
|
|||
# No movies
|
||||
return None, None
|
||||
|
||||
def trakt_get_shows(config_path, plex, data, list_type='userlist'):
|
||||
def trakt_get_shows(config_path, plex, data, method):
|
||||
config_tools.TraktClient(config_path)
|
||||
if list_type == 'userlist':
|
||||
trakt_url = data
|
||||
if trakt_url[-1:] == " ":
|
||||
trakt_url = trakt_url[:-1]
|
||||
trakt_list_path = urlparse(trakt_url).path
|
||||
trakt_list_items = trakt.Trakt[trakt_list_path].items()
|
||||
elif list_type == 'trending':
|
||||
if method == "trakt_trending":
|
||||
max_items = int(data)
|
||||
trakt_list_items = trakt.Trakt['shows'].trending(per_page=max_items)
|
||||
elif list_type == 'watchlist':
|
||||
elif method == "trakt_watchlist":
|
||||
trakt_url = data
|
||||
if trakt_url[-1:] == " ":
|
||||
trakt_url = trakt_url[:-1]
|
||||
trakt_list_path = 'users/{}/watchlist'.format(data)
|
||||
trakt_list_items = [show for show in trakt.Trakt[trakt_list_path].shows()]
|
||||
else:
|
||||
trakt_url = data
|
||||
if trakt_url[-1:] == " ":
|
||||
trakt_url = trakt_url[:-1]
|
||||
trakt_list_path = urlparse(trakt_url).path
|
||||
trakt_list_items = trakt.Trakt[trakt_list_path].items()
|
||||
|
||||
tvdb_map = {}
|
||||
title_ids = []
|
||||
|
|
Loading…
Reference in a new issue