mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-10 23:42:37 -07:00
Automatically append HTTP root to newsletter URL
This commit is contained in:
parent
1f10668838
commit
511f4a916b
5 changed files with 18 additions and 18 deletions
|
@ -1003,7 +1003,7 @@
|
|||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="newsletter_base_url" name="newsletter_base_url" value="${config['newsletter_base_url']}" placeholder="http://mydomain.com" data-parsley-trigger="change" data-parsley-pattern="^https?:\/\/\S+$" data-parsley-errors-container="#newsletter_base_url_error" data-parsley-error-message="Invalid URL">
|
||||
<span class="input-group-btn">
|
||||
<span class="input-group-addon input-group-addon-form">/newsletter</span>
|
||||
<span class="input-group-addon input-group-addon-form">${http_root}newsletter</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
recently_added = data['recently_added']
|
||||
if plexpy.CONFIG.NEWSLETTER_SELF_HOSTED and plexpy.CONFIG.NEWSLETTER_BASE_URL:
|
||||
base_url = plexpy.CONFIG.NEWSLETTER_BASE_URL + '/newsletter/image/'
|
||||
base_url = plexpy.CONFIG.NEWSLETTER_BASE_URL + plexpy.HTTP_ROOT + 'newsletter/image/'
|
||||
elif plexpy.CONFIG.NEWSLETTER_SELF_HOSTED or preview:
|
||||
base_url = 'newsletter/image/'
|
||||
else:
|
||||
|
@ -606,12 +606,12 @@
|
|||
% for movie in recently_added['movie']:
|
||||
<%
|
||||
if loop.index == len(recently_added['movie'])-1 and loop.index % 2 == 0:
|
||||
clear = '<div class="clear"></div>'
|
||||
clear = '<div style="clear: both;"></div>'
|
||||
odd = 'odd'
|
||||
else:
|
||||
clear = odd = ''
|
||||
%>
|
||||
${clear}
|
||||
${clear | n}
|
||||
<div class="card-instance movie ${odd}" style="float: left;width: 500px;margin: 3px;border: 1px solid rgba(255,255,255,.1);-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;font-size: 12px;overflow: hidden;position: relative;height: 235px;">
|
||||
<div class="card-background" style="background-image: url(${(base_url + movie['art_hash']) if base_url else movie['art_url']});background-position: center;background-size: cover;width: 100%;height: 100%;">
|
||||
<div class="card-poster-container" style="width: 150px;margin: 3px;border: 1px solid rgba(255,255,255,.1);float: left;position: relative;z-index: 1;height: 225px;">
|
||||
|
@ -687,12 +687,12 @@
|
|||
link_title = show['title']
|
||||
|
||||
if loop.index == len(recently_added['show'])-1 and loop.index % 2 == 0:
|
||||
clear = '<div class="clear"></div>'
|
||||
clear = '<div style="clear: both;"></div>'
|
||||
odd = 'odd'
|
||||
else:
|
||||
clear = odd = ''
|
||||
%>
|
||||
${clear}
|
||||
${clear | n}
|
||||
<div class="card-instance show ${odd}" style="float: left;width: 500px;margin: 3px;border: 1px solid rgba(255,255,255,.1);-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;font-size: 12px;overflow: hidden;position: relative;height: 235px;">
|
||||
<div class="card-background" style="background-image: url(${(base_url + show['art_hash']) if base_url else show['art_url']});background-position: center;background-size: cover;width: 100%;height: 100%;">
|
||||
<div class="card-poster-container" style="width: 150px;margin: 3px;border: 1px solid rgba(255,255,255,.1);float: left;position: relative;z-index: 1;height: 225px;">
|
||||
|
@ -792,12 +792,12 @@
|
|||
album_count += 1
|
||||
|
||||
if album_count == total_albums and album_count % 2 == 1:
|
||||
clear = '<div class="clear"></div>'
|
||||
clear = '<div style="clear: both;"></div>'
|
||||
odd = 'odd'
|
||||
else:
|
||||
clear = odd = ''
|
||||
%>
|
||||
${clear}
|
||||
${clear | n}
|
||||
<div class="card-instance album ${odd}" style="float: left;width: 500px;margin: 3px;border: 1px solid rgba(255,255,255,.1);-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;font-size: 12px;overflow: hidden;position: relative;height: 160px;">
|
||||
<div class="card-background" style="background-image: url(${(base_url + album['art_hash']) if base_url else album['art_url']});background-position: center;background-size: cover;width: 100%;height: 100%;">
|
||||
<div class="card-poster-container" style="width: 150px;margin: 3px;border: 1px solid rgba(255,255,255,.1);float: left;position: relative;z-index: 1;height: 150px;">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
recently_added = data['recently_added']
|
||||
if plexpy.CONFIG.NEWSLETTER_SELF_HOSTED and plexpy.CONFIG.NEWSLETTER_BASE_URL:
|
||||
base_url = plexpy.CONFIG.NEWSLETTER_BASE_URL + '/newsletter/image/'
|
||||
base_url = plexpy.CONFIG.NEWSLETTER_BASE_URL + plexpy.HTTP_ROOT + 'newsletter/image/'
|
||||
elif plexpy.CONFIG.NEWSLETTER_SELF_HOSTED or preview:
|
||||
base_url = 'newsletter/image/'
|
||||
else:
|
||||
|
@ -606,12 +606,12 @@
|
|||
% for movie in recently_added['movie']:
|
||||
<%
|
||||
if loop.index == len(recently_added['movie'])-1 and loop.index % 2 == 0:
|
||||
clear = '<div class="clear"></div>'
|
||||
clear = '<div style="clear: both;"></div>'
|
||||
odd = 'odd'
|
||||
else:
|
||||
clear = odd = ''
|
||||
%>
|
||||
${clear}
|
||||
${clear | n}
|
||||
<div class="card-instance movie ${odd}">
|
||||
<div class="card-background" style="background-image: url(${(base_url + movie['art_hash']) if base_url else movie['art_url']});">
|
||||
<div class="card-poster-container">
|
||||
|
@ -687,12 +687,12 @@
|
|||
link_title = show['title']
|
||||
|
||||
if loop.index == len(recently_added['show'])-1 and loop.index % 2 == 0:
|
||||
clear = '<div class="clear"></div>'
|
||||
clear = '<div style="clear: both;"></div>'
|
||||
odd = 'odd'
|
||||
else:
|
||||
clear = odd = ''
|
||||
%>
|
||||
${clear}
|
||||
${clear | n}
|
||||
<div class="card-instance show ${odd}">
|
||||
<div class="card-background" style="background-image: url(${(base_url + show['art_hash']) if base_url else show['art_url']});">
|
||||
<div class="card-poster-container">
|
||||
|
@ -792,12 +792,12 @@
|
|||
album_count += 1
|
||||
|
||||
if album_count == total_albums and album_count % 2 == 1:
|
||||
clear = '<div class="clear"></div>'
|
||||
clear = '<div style="clear: both;"></div>'
|
||||
odd = 'odd'
|
||||
else:
|
||||
clear = odd = ''
|
||||
%>
|
||||
${clear}
|
||||
${clear | n}
|
||||
<div class="card-instance album ${odd}">
|
||||
<div class="card-background" style="background-image: url(${(base_url + album['art_hash']) if base_url else album['art_url']});">
|
||||
<div class="card-poster-container">
|
||||
|
|
|
@ -78,8 +78,8 @@ def notify(newsletter_id=None, notify_action=None, **kwargs):
|
|||
return
|
||||
|
||||
if notify_action in ('test', 'api'):
|
||||
subject = kwargs.pop('subject', newsletter_config['subject'])
|
||||
body = kwargs.pop('body', newsletter_config['body'])
|
||||
subject = kwargs.pop('subject', None) or newsletter_config['subject']
|
||||
body = kwargs.pop('body', None) or newsletter_config['body']
|
||||
else:
|
||||
subject = newsletter_config['subject']
|
||||
body = newsletter_config['body']
|
||||
|
|
|
@ -455,7 +455,7 @@ class Newsletter(object):
|
|||
'start_date': self.start_date.format(date_format),
|
||||
'end_date': self.end_date.format(date_format),
|
||||
'newsletter_days': self.config['last_days'],
|
||||
'newsletter_url': base_url.rstrip('/') + '/newsletter/' + self.uuid,
|
||||
'newsletter_url': base_url.rstrip('/') + plexpy.HTTP_ROOT + 'newsletter/' + self.uuid,
|
||||
'newsletter_uuid': self.uuid
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue