diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index e17d38e4..7bc084eb 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -754,7 +754,7 @@
-

Global Notification Settings

+

3rd Party APIs

@@ -775,6 +775,18 @@ You can register a new application here.
+
+ +

Enable to lookup links to TheMovieDB for movies and TV shows when available.

+
+
+ +

Enable to lookup links to TVmaze for TV shows when available.

+

Current Activity Notifications

diff --git a/plexpy/config.py b/plexpy/config.py index b6f7cc4d..91b081b1 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -549,6 +549,8 @@ _CONFIG_DEFINITIONS = { 'TELEGRAM_ON_CONCURRENT': (int, 'Telegram', 0), 'TELEGRAM_ON_NEWDEVICE': (int, 'Telegram', 0), 'THEMOVIEDB_APIKEY': (str, 'General', 'e9a6655bae34bf694a0f3e33338dc28e'), + 'THEMOVIEDB_LOOKUP': (int, 'General', 0), + 'TVMAZE_LOOKUP': (int, 'General', 0), 'TV_LOGGING_ENABLE': (int, 'Monitoring', 1), 'TV_NOTIFY_ENABLE': (int, 'Monitoring', 0), 'TV_NOTIFY_ON_START': (int, 'Monitoring', 1), diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 8ce87e91..dff65b91 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -535,32 +535,34 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m metadata['lastfm_url'] = 'https://www.last.fm/music/' + metadata['lastfm_id'] # Get TheMovieDB info - if metadata.get('themoviedb_id'): - themoveidb_json = get_themoviedb_info(rating_key=rating_key, - media_type=metadata['media_type'], - themoviedb_id=metadata['themoviedb_id']) + if plexpy.CONFIG.THEMOVIEDB_LOOKUP: + if metadata.get('themoviedb_id'): + themoveidb_json = get_themoviedb_info(rating_key=rating_key, + media_type=metadata['media_type'], + themoviedb_id=metadata['themoviedb_id']) - if themoveidb_json.get('imdb_id'): - metadata['imdb_id'] = themoveidb_json['imdb_id'] - metadata['imdb_url'] = 'https://www.imdb.com/title/' + themoveidb_json['imdb_id'] + if themoveidb_json.get('imdb_id'): + metadata['imdb_id'] = themoveidb_json['imdb_id'] + metadata['imdb_url'] = 'https://www.imdb.com/title/' + themoveidb_json['imdb_id'] - elif metadata.get('thetvdb_id') or metadata.get('imdb_id'): - themoviedb_info = lookup_themoviedb_by_id(rating_key=rating_key, - thetvdb_id=metadata.get('thetvdb_id'), - imdb_id=metadata.get('imdb_id')) - metadata.update(themoviedb_info) + elif metadata.get('thetvdb_id') or metadata.get('imdb_id'): + themoviedb_info = lookup_themoviedb_by_id(rating_key=rating_key, + thetvdb_id=metadata.get('thetvdb_id'), + imdb_id=metadata.get('imdb_id')) + metadata.update(themoviedb_info) # Get TVmaze info (for tv shows only) - if metadata['media_type'] in ('show', 'season', 'episode') and (metadata.get('thetvdb_id') or metadata.get('imdb_id')): - tvmaze_info = lookup_tvmaze_by_id(rating_key=rating_key, - thetvdb_id=metadata.get('thetvdb_id'), - imdb_id=metadata.get('imdb_id')) - metadata.update(tvmaze_info) + if plexpy.CONFIG.TVMAZE_LOOKUP: + if metadata['media_type'] in ('show', 'season', 'episode') and (metadata.get('thetvdb_id') or metadata.get('imdb_id')): + tvmaze_info = lookup_tvmaze_by_id(rating_key=rating_key, + thetvdb_id=metadata.get('thetvdb_id'), + imdb_id=metadata.get('imdb_id')) + metadata.update(tvmaze_info) - if tvmaze_info.get('thetvdb_id'): - metadata['thetvdb_url'] = 'https://thetvdb.com/?tab=series&id=' + str(tvmaze_info['thetvdb_id']) - if tvmaze_info.get('imdb_id'): - metadata['imdb_url'] = 'https://www.imdb.com/title/' + tvmaze_info['imdb_id'] + if tvmaze_info.get('thetvdb_id'): + metadata['thetvdb_url'] = 'https://thetvdb.com/?tab=series&id=' + str(tvmaze_info['thetvdb_id']) + if tvmaze_info.get('imdb_id'): + metadata['imdb_url'] = 'https://www.imdb.com/title/' + tvmaze_info['imdb_id'] if metadata['media_type'] in ('movie', 'show', 'artist'): poster_thumb = metadata['thumb'] diff --git a/plexpy/webserve.py b/plexpy/webserve.py index a572269b..740a7412 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -2648,7 +2648,9 @@ class WebInterface(object): "git_remote": plexpy.CONFIG.GIT_REMOTE, "movie_watched_percent": plexpy.CONFIG.MOVIE_WATCHED_PERCENT, "tv_watched_percent": plexpy.CONFIG.TV_WATCHED_PERCENT, - "music_watched_percent": plexpy.CONFIG.MUSIC_WATCHED_PERCENT + "music_watched_percent": plexpy.CONFIG.MUSIC_WATCHED_PERCENT, + "themoviedb_lookup": checked(plexpy.CONFIG.THEMOVIEDB_LOOKUP), + "tvmaze_lookup": checked(plexpy.CONFIG.TVMAZE_LOOKUP) } return serve_template(templatename="settings.html", title="Settings", config=config, kwargs=kwargs) @@ -2668,7 +2670,8 @@ class WebInterface(object): "notify_group_recently_added_grandparent", "notify_group_recently_added_parent", "monitor_pms_updates", "monitor_remote_access", "get_file_sizes", "log_blacklist", "http_hash_password", "allow_guest_access", "cache_images", "http_basic_auth", "notify_concurrent_by_ip", - "history_table_activity", "plexpy_auto_update" + "history_table_activity", "plexpy_auto_update", + "themoviedb_lookup", "tvmaze_lookup" ] for checked_config in checked_configs: if checked_config not in kwargs: