diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index e8805bc6..35d4df4f 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -713,6 +713,13 @@ available_notification_agents = sorted(notifiers.available_notification_agents() +
+ +

Allow PlexPy to upload Plex poster to Imgur for notifications.

+
+

Current Activity Notifications

diff --git a/plexpy/config.py b/plexpy/config.py index 53e6eed3..dd4a8586 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -191,6 +191,7 @@ _CONFIG_DEFINITIONS = { 'NMA_ON_EXTUP': (int, 'NMA', 0), 'NMA_ON_INTUP': (int, 'NMA', 0), 'NOTIFY_CONSECUTIVE': (int, 'Monitoring', 1), + 'NOTIFY_UPLOAD_POSTERS': (int, 'Monitoring', 0), 'NOTIFY_RECENTLY_ADDED': (int, 'Monitoring', 0), 'NOTIFY_RECENTLY_ADDED_GRANDPARENT': (int, 'Monitoring', 0), 'NOTIFY_RECENTLY_ADDED_DELAY': (int, 'Monitoring', 60), diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index b9a00028..cf5a15df 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -565,7 +565,7 @@ def build_notify_text(session=None, timeline=None, notify_action=None): poster_url = data_factory.get_poster_url(rating_key=poster_key) # If no previous poster_url - if not poster_url: + if not poster_url and plexpy.CONFIG.NOTIFY_UPLOAD_POSTERS: # Retrieve the poster from Plex and cache to file urllib.urlretrieve(plexpy.CONFIG.PMS_URL + thumb + '?X-Plex-Token=' + plexpy.CONFIG.PMS_TOKEN, os.path.join(plexpy.CONFIG.CACHE_DIR, 'cache-poster.jpg')) diff --git a/plexpy/webserve.py b/plexpy/webserve.py index d077777f..d50dcf5a 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -1192,6 +1192,7 @@ class WebInterface(object): "logging_ignore_interval": plexpy.CONFIG.LOGGING_IGNORE_INTERVAL, "pms_is_remote": checked(plexpy.CONFIG.PMS_IS_REMOTE), "notify_consecutive": checked(plexpy.CONFIG.NOTIFY_CONSECUTIVE), + "notify_upload_posters": checked(plexpy.CONFIG.NOTIFY_UPLOAD_POSTERS), "notify_recently_added": checked(plexpy.CONFIG.NOTIFY_RECENTLY_ADDED), "notify_recently_added_grandparent": checked(plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_GRANDPARENT), "notify_recently_added_delay": plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_DELAY, @@ -1244,7 +1245,7 @@ class WebInterface(object): "tv_notify_on_pause", "movie_notify_on_pause", "music_notify_on_pause", "refresh_libraries_on_startup", "refresh_users_on_startup", "ip_logging_enable", "movie_logging_enable", "tv_logging_enable", "music_logging_enable", - "pms_is_remote", "home_stats_type", "group_history_tables", "notify_consecutive", + "pms_is_remote", "home_stats_type", "group_history_tables", "notify_consecutive", "notify_upload_posters", "notify_recently_added", "notify_recently_added_grandparent", "monitor_remote_access", "get_file_sizes" ] for checked_config in checked_configs: