diff --git a/data/interfaces/default/css/tautulli.css b/data/interfaces/default/css/tautulli.css index 961f6447..e18cefd9 100644 --- a/data/interfaces/default/css/tautulli.css +++ b/data/interfaces/default/css/tautulli.css @@ -4025,3 +4025,6 @@ a:hover .overlay-refresh-image:hover { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } +a[data-tab-destination] { + cursor: pointer; +} \ No newline at end of file diff --git a/data/interfaces/default/newsletter_config.html b/data/interfaces/default/newsletter_config.html index b92fe3ad..48471eaa 100644 --- a/data/interfaces/default/newsletter_config.html +++ b/data/interfaces/default/newsletter_config.html @@ -240,7 +240,7 @@

Select an existing notification agent where the subject and body text will be sent.
- Note: Self-hosted newsletters must be enabled under Newsletters to include a link to the newsletter. + Note: Self-hosted newsletters must be enabled under Newsletters to include a link to the newsletter.

diff --git a/data/interfaces/default/notifier_config.html b/data/interfaces/default/notifier_config.html index 977d8895..45a23499 100644 --- a/data/interfaces/default/notifier_config.html +++ b/data/interfaces/default/notifier_config.html @@ -433,7 +433,7 @@ '
' + '' + '

Facebook requires HTTPS for authorization. ' + - 'Please enable HTTPS for Tautulli under Web Interface.

' + + 'Please enable HTTPS for Tautulli under Web Interface.

' + '
' ); $('#facebook_redirect_uri').val('HTTPS not enabled'); diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 499e0039..70858c3c 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -50,9 +50,8 @@
  • Homepage
  • Web Interface
  • Plex Media Server
  • -
  • Notifications
  • +
  • Notifications & Newsletters
  • Notification Agents
  • -
  • Newsletters
  • Newsletter Agents
  • Import & Backups
  • Tautulli Remote Android App beta
  • @@ -441,6 +440,18 @@

    Port to bind web server to. Note that ports below 1024 may require root.

    +
    + +
    +
    + +
    + +
    +

    + Set your Tautulli public domain for self-hosted notification images and newsletters. (e.g. http://mydomain.com)
    +

    +
    @@ -924,16 +935,38 @@
    -->
    -

    3rd Party APIs

    +

    Newsletters

    -

    Enable to upload Plex posters to Imgur for notifications. Disable if posters are not being used to save bandwidth.

    +

    Enable to self-host newsletters on your own domain.

    -
    +
    +

    Note: The ${http_root}newsletter endpoint on your domain must be publically accessible from the internet.

    +

    Warning: Tautulli public domain not set under Web Interface.

    +
    + +
    +

    3rd Party APIs

    +
    + +
    + +
    +
    + +
    +
    +

    Select where to host Plex images for notifications and newsletters.

    +
    +
    @@ -946,6 +979,10 @@ You can register a new application here.
    +
    +

    Note: The ${http_root}image endpoint on your domain must be publically accessible from the internet.

    +

    Warning: Tautulli public domain not set under Web Interface.

    +
    -
    - -
    -

    Newsletters

    -
    - -
    - -

    Enable to self-host newsletters on your own domain.

    -
    -
    -
    - -
    -
    -
    - - - ${http_root}newsletter - -
    -
    - -
    -

    - Set your Tautulli base URL for self-hosted newsletters. (e.g. http://mydomain.com)
    - Note: The ${http_root}newsletter endpoint on your domain must be accessible from the internet. -

    -
    -
    - -

    - -
    -
    @@ -1030,7 +1030,7 @@ Add a new newsletter agent, or configure an existing newsletter agent by clicking the settings icon on the right.

    - Note: Either Imgur uploads or self-hosted newsletters must be enabled. + Note: Either Image Hosting on Imgur or Self-Hosted Newsletters must be enabled.


    @@ -1150,7 +1150,7 @@

    Register a new device using a QR code, or configure an existing device by clicking the settings icon on the right.

    -

    The API must be enabled under Web Interface to use the app.

    +

    The API must be enabled under Web Interface to use the app.

    Loading registered devices...
    @@ -1815,7 +1815,6 @@ $(document).ready(function() { initConfigCheckbox('#enable_https'); initConfigCheckbox('#https_create_cert'); initConfigCheckbox('#check_github'); - initConfigCheckbox('#notify_upload_posters'); initConfigCheckbox('#monitor_pms_updates'); initConfigCheckbox('#newsletter_self_hosted'); @@ -2499,11 +2498,11 @@ $(document).ready(function() { }); }); - $('#newsletter_base_url').change(function () { + $('#http_base_url').change(function () { $(this).val($(this).val().replace(/\/*$/, '')); }); - function apiEnabled () { + function apiEnabled() { var api_enabled = $('#api_enabled').prop('checked'); $('#app_api_msg').toggle(!(api_enabled)); } @@ -2512,7 +2511,37 @@ $(document).ready(function() { apiEnabled(); }); - function newsletterUploadEnabled () { + function imageUpload() { + var upload_val = $('#notify_upload_posters').val(); + if (upload_val === '1') { + $('#imgur_upload_options').slideDown(); + } else { + $('#imgur_upload_options').slideUp(); + } + if (upload_val === '2') { + $('#self_host_image_options').slideDown(); + } else { + $('#self_host_image_options').slideUp(); + } + } + $('#notify_upload_posters').change(function () { + imageUpload(); + }); + + function baseURLSet() { + if ($('#http_base_url').val()) { + $('.base-url-warning').hide(); + } else { + $('.base-url-warning').show(); + } + } + baseURLSet(); + + $('#http_base_url').change(function () { + baseURLSet(); + }); + + function newsletterUploadEnabled() { if ($('#notify_upload_posters').is(':checked') || $('#newsletter_self_hosted').is(':checked')) { $('#newsletter_upload_warning').hide(); } else { @@ -2522,6 +2551,7 @@ $(document).ready(function() { newsletterUploadEnabled(); $('#notify_upload_posters, #newsletter_self_hosted').change(function () { + baseURLSet(); newsletterUploadEnabled(); }); diff --git a/data/interfaces/newsletters/recently_added.html b/data/interfaces/newsletters/recently_added.html index dd210aaa..6e1458c5 100644 --- a/data/interfaces/newsletters/recently_added.html +++ b/data/interfaces/newsletters/recently_added.html @@ -4,8 +4,8 @@ from plexpy.helpers import grouper recently_added = data['recently_added'] - if plexpy.CONFIG.NEWSLETTER_SELF_HOSTED and plexpy.CONFIG.NEWSLETTER_BASE_URL: - base_url = plexpy.CONFIG.NEWSLETTER_BASE_URL + plexpy.HTTP_ROOT + 'newsletter/' + if plexpy.CONFIG.NEWSLETTER_SELF_HOSTED and plexpy.CONFIG.HTTP_BASE_URL: + base_url = plexpy.CONFIG.HTTP_BASE_URL + plexpy.HTTP_ROOT + 'newsletter/' base_url_image = base_url + 'image/' elif preview: base_url = 'newsletter/' diff --git a/data/interfaces/newsletters/recently_added_master.html b/data/interfaces/newsletters/recently_added_master.html index 79ffcc14..526ad3fd 100644 --- a/data/interfaces/newsletters/recently_added_master.html +++ b/data/interfaces/newsletters/recently_added_master.html @@ -4,8 +4,8 @@ from plexpy.helpers import grouper recently_added = data['recently_added'] - if plexpy.CONFIG.NEWSLETTER_SELF_HOSTED and plexpy.CONFIG.NEWSLETTER_BASE_URL: - base_url = plexpy.CONFIG.NEWSLETTER_BASE_URL + plexpy.HTTP_ROOT + 'newsletter/' + if plexpy.CONFIG.NEWSLETTER_SELF_HOSTED and plexpy.CONFIG.HTTP_BASE_URL: + base_url = plexpy.CONFIG.HTTP_BASE_URL + plexpy.HTTP_ROOT + 'newsletter/' base_url_image = base_url + 'image/' elif preview: base_url = 'newsletter/' diff --git a/plexpy/config.py b/plexpy/config.py index b4006e78..d3a6df68 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -226,6 +226,7 @@ _CONFIG_DEFINITIONS = { 'HTTP_ROOT': (str, 'General', ''), 'HTTP_USERNAME': (str, 'General', ''), 'HTTP_PLEX_ADMIN': (int, 'General', 0), + 'HTTP_BASE_URL': (str, 'General', ''), 'HIPCHAT_URL': (str, 'Hipchat', ''), 'HIPCHAT_COLOR': (str, 'Hipchat', ''), 'HIPCHAT_INCL_SUBJECT': (int, 'Hipchat', 1), @@ -310,7 +311,6 @@ _CONFIG_DEFINITIONS = { 'NEWSLETTER_TEMPLATES': (str, 'Newsletter', 'newsletters'), 'NEWSLETTER_DIR': (str, 'Newsletter', ''), 'NEWSLETTER_SELF_HOSTED': (int, 'Newsletter', 0), - 'NEWSLETTER_BASE_URL': (str, 'Newsletter', ''), 'NMA_APIKEY': (str, 'NMA', ''), 'NMA_ENABLED': (int, 'NMA', 0), 'NMA_PRIORITY': (int, 'NMA', 0), diff --git a/plexpy/newsletters.py b/plexpy/newsletters.py index e375ee93..6bb35516 100644 --- a/plexpy/newsletters.py +++ b/plexpy/newsletters.py @@ -458,7 +458,7 @@ class Newsletter(object): def _build_params(self): date_format = helpers.momentjs_to_arrow(plexpy.CONFIG.DATE_FORMAT) - base_url = plexpy.CONFIG.NEWSLETTER_BASE_URL or helpers.get_plexpy_url() + base_url = plexpy.CONFIG.HTTP_BASE_URL or helpers.get_plexpy_url() parameters = { 'server_name': plexpy.CONFIG.PMS_NAME, diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 609719c7..05408018 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -632,10 +632,15 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m else: poster_thumb = '' - if plexpy.CONFIG.NOTIFY_UPLOAD_POSTERS: + if plexpy.CONFIG.NOTIFY_UPLOAD_POSTERS == 1: imgur_info = get_imgur_info(img=poster_thumb, rating_key=poster_key, title=poster_title, fallback='poster') poster_info = {'poster_title': imgur_info['imgur_title'], 'poster_url': imgur_info['imgur_url']} notify_params.update(poster_info) + elif plexpy.CONFIG.NOTIFY_UPLOAD_POSTERS == 2 and plexpy.CONFIG.HTTP_BASE_URL: + img_hash = set_hash_image_info(img=poster_thumb, fallback='poster') + poster_info = {'poster_title': poster_title, + 'poster_url': plexpy.CONFIG.HTTP_BASE_URL + plexpy.HTTP_ROOT + 'image/' + img_hash} + notify_params.update(poster_info) if ((manual_trigger or plexpy.CONFIG.NOTIFY_GROUP_RECENTLY_ADDED_GRANDPARENT) and notify_params['media_type'] in ('show', 'artist')): diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index 29028e0a..422508d4 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -960,8 +960,8 @@ class ANDROIDAPP(Notifier): config_option.append({ 'label': 'Device', 'description': 'No devices registered. ' - 'Get the Android App and register a device.', + '' + 'Get the Android App and register a device.', 'input_type': 'help' }) else: @@ -970,8 +970,8 @@ class ANDROIDAPP(Notifier): 'value': self.config['device_id'], 'name': 'androidapp_device_id', 'description': 'Set your Android app device or ' - 'register a new device with Tautulli.', + '' + 'register a new device with Tautulli.', 'input_type': 'select', 'select_options': devices }) @@ -1224,7 +1224,7 @@ class DISCORD(Notifier): 'value': self.config['incl_card'], 'name': 'discord_incl_card', 'description': 'Include an info card with a poster and metadata with the notifications.
    ' - 'Note: Imgur upload may need to be enabled under the notifications settings tab.', + 'Note: Image hosting must be enabled under the notifications settings tab.', 'input_type': 'checkbox' }, {'label': 'Include Plot Summaries', @@ -1574,7 +1574,7 @@ class FACEBOOK(Notifier): 'value': self.config['incl_card'], 'name': 'facebook_incl_card', 'description': 'Include an info card with a poster and metadata with the notifications.
    ' - 'Note: Imgur upload may need to be enabled under the notifications settings tab.', + 'Note: Image hosting must be enabled under the notifications settings tab.', 'input_type': 'checkbox' }, {'label': 'Movie Link Source', @@ -1895,7 +1895,7 @@ class HIPCHAT(Notifier): 'value': self.config['incl_card'], 'name': 'hipchat_incl_card', 'description': 'Include an info card with a poster and metadata with the notifications.
    ' - 'Note: Imgur upload may need to be enabled under the notifications settings tab.
    ' + 'Note: Image hosting must be enabled under the notifications settings tab.
    ' 'Note: This will change the notification type to HTML and emoticons will no longer work.', 'input_type': 'checkbox' }, @@ -2114,7 +2114,7 @@ class JOIN(Notifier): 'value': self.config['incl_poster'], 'name': 'join_incl_poster', 'description': 'Include a poster with the notifications.
    ' - 'Note: Imgur upload may need to be enabled under the notifications settings tab.', + 'Note: Image hosting must be enabled under the notifications settings tab.', 'input_type': 'checkbox' }, {'label': 'Movie Link Source', @@ -3223,7 +3223,7 @@ class SLACK(Notifier): 'value': self.config['incl_card'], 'name': 'slack_incl_card', 'description': 'Include an info card with a poster and metadata with the notifications.
    ' - 'Note: Imgur upload may need to be enabled under the notifications settings tab.', + 'Note: Image hosting must be enabled under the notifications settings tab.', 'input_type': 'checkbox' }, {'label': 'Include Plot Summaries', @@ -3455,7 +3455,7 @@ class TWITTER(Notifier): 'value': self.config['incl_poster'], 'name': 'twitter_incl_poster', 'description': 'Include a poster with the notifications.
    ' - 'Note: Imgur upload may need to be enabled under the notifications settings tab.', + 'Note: Image hosting must be enabled under the notifications settings tab.', 'input_type': 'checkbox' } ] diff --git a/plexpy/webserve.py b/plexpy/webserve.py index b9189f8f..bc9b0c86 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -2678,6 +2678,7 @@ class WebInterface(object): "https_key": plexpy.CONFIG.HTTPS_KEY, "https_domain": plexpy.CONFIG.HTTPS_DOMAIN, "https_ip": plexpy.CONFIG.HTTPS_IP, + "http_base_url": plexpy.CONFIG.HTTP_BASE_URL, "anon_redirect": plexpy.CONFIG.ANON_REDIRECT, "api_enabled": checked(plexpy.CONFIG.API_ENABLED), "api_key": plexpy.CONFIG.API_KEY, @@ -2719,7 +2720,7 @@ class WebInterface(object): "refresh_users_on_startup": checked(plexpy.CONFIG.REFRESH_USERS_ON_STARTUP), "logging_ignore_interval": plexpy.CONFIG.LOGGING_IGNORE_INTERVAL, "notify_consecutive": checked(plexpy.CONFIG.NOTIFY_CONSECUTIVE), - "notify_upload_posters": checked(plexpy.CONFIG.NOTIFY_UPLOAD_POSTERS), + "notify_upload_posters": plexpy.CONFIG.NOTIFY_UPLOAD_POSTERS, "notify_recently_added_upgrade": checked(plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_UPGRADE), "notify_group_recently_added_grandparent": checked(plexpy.CONFIG.NOTIFY_GROUP_RECENTLY_ADDED_GRANDPARENT), "notify_group_recently_added_parent": checked(plexpy.CONFIG.NOTIFY_GROUP_RECENTLY_ADDED_PARENT), @@ -2747,8 +2748,7 @@ class WebInterface(object): "tvmaze_lookup": checked(plexpy.CONFIG.TVMAZE_LOOKUP), "show_advanced_settings": plexpy.CONFIG.SHOW_ADVANCED_SETTINGS, "newsletter_dir": plexpy.CONFIG.NEWSLETTER_DIR, - "newsletter_self_hosted": checked(plexpy.CONFIG.NEWSLETTER_SELF_HOSTED), - "newsletter_base_url": plexpy.CONFIG.NEWSLETTER_BASE_URL + "newsletter_self_hosted": checked(plexpy.CONFIG.NEWSLETTER_SELF_HOSTED) } return serve_template(templatename="settings.html", title="Settings", config=config, kwargs=kwargs) @@ -2764,7 +2764,7 @@ class WebInterface(object): "grouping_global_history", "grouping_user_history", "grouping_charts", "group_history_tables", "pms_url_manual", "week_start_monday", "refresh_libraries_on_startup", "refresh_users_on_startup", - "notify_consecutive", "notify_upload_posters", "notify_recently_added_upgrade", + "notify_consecutive", "notify_recently_added_upgrade", "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_proxy", "http_basic_auth", "notify_concurrent_by_ip",