From 67c3b625aa0a980a0fedf099121a21be8f2f6eaf Mon Sep 17 00:00:00 2001 From: Marc Beaulieu Date: Thu, 28 Aug 2014 12:43:23 -0300 Subject: [PATCH 1/6] Added Remove show functionality --- modules/sickbeard.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/sickbeard.py b/modules/sickbeard.py index 015a83c25..87b95815d 100644 --- a/modules/sickbeard.py +++ b/modules/sickbeard.py @@ -151,6 +151,13 @@ def ForceFullUpdate(self, tvdbid): def RescanFiles(self, tvdbid): self.logger.debug("Rescan all local files for tvdbid " + tvdbid) return self.fetch("show.refresh&tvdbid=" + tvdbid) + + @cherrypy.expose() + @require() + @cherrypy.tools.json_out() + def RemoveShow(self, tvdbid): + self.logger.debug("Removing Show tvdbid " + tvdbid) + return self.fetch("show.delete&tvdbid=" + tvdbid) @cherrypy.expose() @require() From 9d9d9c9a40ddb67e213e6467c9fb26b8f4f899ce Mon Sep 17 00:00:00 2001 From: Marc Beaulieu Date: Thu, 28 Aug 2014 12:44:33 -0300 Subject: [PATCH 2/6] Added Remove show functionality --- interfaces/default/html/sickbeard_view.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/interfaces/default/html/sickbeard_view.html b/interfaces/default/html/sickbeard_view.html index ca395fdb0..af95b9a99 100644 --- a/interfaces/default/html/sickbeard_view.html +++ b/interfaces/default/html/sickbeard_view.html @@ -15,6 +15,9 @@

  • Rescan files
  • +
  • + Remove show +
  • From 88ed9a547e50785b843d9852168e5ebe26120641 Mon Sep 17 00:00:00 2001 From: Marc Beaulieu Date: Thu, 28 Aug 2014 12:45:45 -0300 Subject: [PATCH 3/6] Added Remove show functionality --- interfaces/default/js/sickbeard_view.js | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/interfaces/default/js/sickbeard_view.js b/interfaces/default/js/sickbeard_view.js index 17c4a53f8..8ab235a45 100644 --- a/interfaces/default/js/sickbeard_view.js +++ b/interfaces/default/js/sickbeard_view.js @@ -34,6 +34,11 @@ function loadShowData(showid){ evt.preventDefault(); forceFullUpdate(showid, data.show_name); }); + + $('.remove-show', menu).click(function(evt) { + evt.preventDefault(); + removeShow(showid, data.show_name); + }); renderSeasonTabs(showid, data.season_list); }, @@ -268,6 +273,37 @@ function rescanFiles(tvdbid, name) { }); } +function removeShow(tvdbid, name) { + var modalcontent = $('
    '); + modalcontent.append($('

    ').html('Removing "' + name +' " from list')); + modalcontent.append($('

    ').html('
    ')); + showModal('Removing...', modalcontent, {}); + + $.ajax({ + url: WEBDIR + 'sickbeard/RemoveShow?tvdbid=' + tvdbid, + type: 'get', + dataType: 'json', + timeout: 15000, + success: function (data) { + // If result is not 'succes' it must be a failure + if (data.result != 'success') { + notify('Error', data.message, 'error'); + return; + } else { + notify('OK', data.message, 'success'); + document.location.href = '../'; + return; + } + }, + error: function (data) { + notify('Error', 'Unable to remove tv show from list.', 'error', 1); + }, + complete: function (data) { + hideModal(); + } + }); +} + function searchEpisode(tvdbid, season, episode, name) { var modalcontent = $('
    '); modalcontent.append($('

    ').html('Looking for episode "'+ name +'".')); From dc932a993643312c826f9c7f5f72cf734595ef9a Mon Sep 17 00:00:00 2001 From: Marc Beaulieu Date: Thu, 28 Aug 2014 12:51:31 -0300 Subject: [PATCH 4/6] Update sickbeard_view.js --- interfaces/default/js/sickbeard_view.js | 56 +++++++++++++------------ 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/interfaces/default/js/sickbeard_view.js b/interfaces/default/js/sickbeard_view.js index 8ab235a45..90cf70d17 100644 --- a/interfaces/default/js/sickbeard_view.js +++ b/interfaces/default/js/sickbeard_view.js @@ -274,34 +274,36 @@ function rescanFiles(tvdbid, name) { } function removeShow(tvdbid, name) { - var modalcontent = $('

    '); - modalcontent.append($('

    ').html('Removing "' + name +' " from list')); - modalcontent.append($('

    ').html('
    ')); - showModal('Removing...', modalcontent, {}); - - $.ajax({ - url: WEBDIR + 'sickbeard/RemoveShow?tvdbid=' + tvdbid, - type: 'get', - dataType: 'json', - timeout: 15000, - success: function (data) { - // If result is not 'succes' it must be a failure - if (data.result != 'success') { - notify('Error', data.message, 'error'); - return; - } else { - notify('OK', data.message, 'success'); - document.location.href = '../'; - return; + if (confirm('Are you sure?')) { + var modalcontent = $('
    '); + modalcontent.append($('

    ').html('Removing "' + name +' " from list')); + modalcontent.append($('

    ').html('
    ')); + showModal('Removing...', modalcontent, {}); + + $.ajax({ + url: WEBDIR + 'sickbeard/RemoveShow?tvdbid=' + tvdbid, + type: 'get', + dataType: 'json', + timeout: 15000, + success: function (data) { + // If result is not 'succes' it must be a failure + if (data.result != 'success') { + notify('Error', data.message, 'error'); + return; + } else { + notify('OK', data.message, 'success'); + document.location.href = '../'; + return; + } + }, + error: function (data) { + notify('Error', 'Unable to remove tv show from list.', 'error', 1); + }, + complete: function (data) { + hideModal(); } - }, - error: function (data) { - notify('Error', 'Unable to remove tv show from list.', 'error', 1); - }, - complete: function (data) { - hideModal(); - } - }); + }); + } } function searchEpisode(tvdbid, season, episode, name) { From af4c8186569f90030b2634f116deeaee5fecb80e Mon Sep 17 00:00:00 2001 From: Marc Beaulieu Date: Thu, 28 Aug 2014 12:58:18 -0300 Subject: [PATCH 5/6] Added Remove show functionality --- interfaces/default/js/sickbeard_view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/default/js/sickbeard_view.js b/interfaces/default/js/sickbeard_view.js index 90cf70d17..031b3509e 100644 --- a/interfaces/default/js/sickbeard_view.js +++ b/interfaces/default/js/sickbeard_view.js @@ -274,7 +274,7 @@ function rescanFiles(tvdbid, name) { } function removeShow(tvdbid, name) { - if (confirm('Are you sure?')) { + if (confirm('Are you sure you want to remove' + name +'?')) { var modalcontent = $('
    '); modalcontent.append($('

    ').html('Removing "' + name +' " from list')); modalcontent.append($('

    ').html('
    ')); From 43b190faed723162aaa0ef7917d5610102865f68 Mon Sep 17 00:00:00 2001 From: Marc Beaulieu Date: Thu, 28 Aug 2014 12:59:32 -0300 Subject: [PATCH 6/6] Update sickbeard_view.js --- interfaces/default/js/sickbeard_view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/default/js/sickbeard_view.js b/interfaces/default/js/sickbeard_view.js index 031b3509e..0985f6feb 100644 --- a/interfaces/default/js/sickbeard_view.js +++ b/interfaces/default/js/sickbeard_view.js @@ -274,7 +274,7 @@ function rescanFiles(tvdbid, name) { } function removeShow(tvdbid, name) { - if (confirm('Are you sure you want to remove' + name +'?')) { + if (confirm('Are you sure you want to remove ' + name +'?')) { var modalcontent = $('
    '); modalcontent.append($('

    ').html('Removing "' + name +' " from list')); modalcontent.append($('

    ').html('
    '));