1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-08-13 16:53:54 -04:00
Adds missing code for saving per show email notifications
This commit is contained in:
CoRpO 2015-01-08 15:01:12 +01:00
parent 8b84e4f4bc
commit 9aa28d18d2
3 changed files with 21 additions and 0 deletions

View File

@ -1537,6 +1537,10 @@
<span class="component-title">&nbsp;</span>
<span class="component-desc">configure per show notifications here.</span>
</label>
<label>
<span class="component-title">&nbsp;</span>
<input id="email_show_save" class="btn" type="button" value="Save for this show" />
</label>
</div>
<div class="testNotification" id="testEmail-result">Click below to test.</div>

View File

@ -466,6 +466,13 @@ $(document).ready(function(){
// Load the per show notify lists everytime this page is loaded
load_show_notify_lists();
$('#email_show_save').click(function() {
$.post(sbRoot + "/home/saveShowNotifyList", { show: $('#email_show').val(), emails: $('#email_show_list').val()}, function (data) {
// Reload the per show notify lists to reflect changes
load_show_notify_lists();
});
});
// show instructions for plex when enabled
$('#use_plex').click(function() {
if ( $(this).is(':checked') ) {

View File

@ -941,6 +941,16 @@ class Home(WebRoot):
return json.dumps(data)
def saveShowNotifyList(self, show=None, emails=None):
# self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
myDB = db.DBConnection()
if myDB.action("UPDATE tv_shows SET notify_list = ? WHERE show_id = ?", [emails, show]):
return 'OK'
else:
return 'ERROR: %s' % myDB.last_err
def testEmail(self, host=None, port=None, smtp_from=None, use_tls=None, user=None, pwd=None, to=None):
# self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')