diff --git a/gui/slick/interfaces/default/manage.tmpl b/gui/slick/interfaces/default/manage.tmpl
index 64882eca..c20e8199 100644
--- a/gui/slick/interfaces/default/manage.tmpl
+++ b/gui/slick/interfaces/default/manage.tmpl
@@ -102,6 +102,7 @@
#end if
Delete
|
+ Remove
|
@@ -120,6 +121,7 @@ $myShowList.sort(lambda x, y: cmp(x.name, y.name))
#set $curRename_disabled = ""
#set $curSubtitle_disabled = ""
#set $curDelete_disabled = ""
+#set $curRemove_disabled = ""
#if $sickbeard.showQueueScheduler.action.isBeingUpdated($curShow) or $sickbeard.showQueueScheduler.action.isInUpdateQueue($curShow):
#set $curUpdate_disabled = "disabled=\"disabled\" "
@@ -141,6 +143,10 @@ $myShowList.sort(lambda x, y: cmp(x.name, y.name))
#set $curDelete = "disabled=\"disabled\" "
#end if
#set $curDelete = ""
+#if $sickbeard.showQueueScheduler.action.isBeingRenamed($curShow) or $sickbeard.showQueueScheduler.action.isInRenameQueue($curShow) or $sickbeard.showQueueScheduler.action.isInRefreshQueue($curShow):
+ #set $curRemove = "disabled=\"disabled\" "
+#end if
+#set $curRemove = ""
|
@@ -163,6 +169,7 @@ $myShowList.sort(lambda x, y: cmp(x.name, y.name))
$curSubtitle |
#end if
$curDelete |
+ $curRemove |
#end for
diff --git a/gui/slick/js/massUpdate.js b/gui/slick/js/massUpdate.js
index 42469672..b27f574c 100644
--- a/gui/slick/js/massUpdate.js
+++ b/gui/slick/js/massUpdate.js
@@ -24,6 +24,7 @@ $(document).ready(function(){
var renameArr = new Array()
var subtitleArr = new Array()
var deleteArr = new Array()
+ var removeArr = new Array()
var metadataArr = new Array()
$('.updateCheck').each(function() {
@@ -56,6 +57,12 @@ $(document).ready(function(){
}
});
+ $('.removeCheck').each(function() {
+ if (this.checked == true) {
+ removeArr.push($(this).attr('id').split('-')[1])
+ }
+ });
+
/*
$('.metadataCheck').each(function() {
if (this.checked == true) {
@@ -63,10 +70,10 @@ $(document).ready(function(){
}
});
*/
- if (updateArr.length+refreshArr.length+renameArr.length+subtitleArr.length+deleteArr.length+metadataArr.length == 0)
+ if (updateArr.length+refreshArr.length+renameArr.length+subtitleArr.length+deleteArr.length+removeArr.length+metadataArr.length == 0)
return false
- url = 'massUpdate?toUpdate='+updateArr.join('|')+'&toRefresh='+refreshArr.join('|')+'&toRename='+renameArr.join('|')+'&toSubtitle='+subtitleArr.join('|')+'&toDelete='+deleteArr.join('|')+'&toMetadata='+metadataArr.join('|')
+ url = 'massUpdate?toUpdate='+updateArr.join('|')+'&toRefresh='+refreshArr.join('|')+'&toRename='+renameArr.join('|')+'&toSubtitle='+subtitleArr.join('|')+'&toDelete='+deleteArr.join('|')+'&toRemove='+removeArr.join('|')+'&toMetadata='+metadataArr.join('|')
window.location.href = url
@@ -83,7 +90,7 @@ $(document).ready(function(){
});
});
- ['.editCheck', '.updateCheck', '.refreshCheck', '.renameCheck', '.deleteCheck'].forEach(function(name) {
+ ['.editCheck', '.updateCheck', '.refreshCheck', '.renameCheck', '.deleteCheck', '.removeCheck'].forEach(function(name) {
var lastCheck = null;
$(name).click(function(event) {
diff --git a/lib/tvdb_api/tvdb_api.py b/lib/tvdb_api/tvdb_api.py
index bb81599d..68071a29 100644
--- a/lib/tvdb_api/tvdb_api.py
+++ b/lib/tvdb_api/tvdb_api.py
@@ -628,21 +628,10 @@ class Tvdb:
"""Loads a URL using caching, returns an ElementTree of the source
"""
try:
- src = self._loadUrl(url, params=params, language=language)
- src = [src[item] for item in src][0] if src else []
+ src = self._loadUrl(url, params=params, language=language).values()[0]
+ return src
except:
- errormsg = "There was an error with the XML retrieved from thetvdb.com:"
-
- if self.config['cache_enabled']:
- errormsg += "\nFirst try emptying the cache folder at..\n%s" % (
- self.config['cache_location']
- )
-
- errormsg += "\nIf this does not resolve the issue, please try again later. If the error persists, report a bug on"
- errormsg += "\nhttp://dbr.lighthouseapp.com/projects/13342-tvdb_api/overview\n"
- raise tvdb_error(errormsg)
-
- return src
+ return []
def _setItem(self, sid, seas, ep, attrib, value):
"""Creates a new episode, creating Show(), Season() and
@@ -692,8 +681,12 @@ class Tvdb:
series = series.encode("utf-8")
log().debug("Searching for show %s" % series)
self.config['params_getSeries']['seriesname'] = series
- seriesEt = self._getetsrc(self.config['url_getSeries'], self.config['params_getSeries'])
- return [seriesEt[item] for item in seriesEt][0] if seriesEt else []
+
+ try:
+ seriesFound = self._getetsrc(self.config['url_getSeries'], self.config['params_getSeries']).values()[0]
+ return seriesFound
+ except:
+ return []
def _getSeries(self, series):
"""This searches TheTVDB.com for the series name,
diff --git a/lib/tvrage_api/tvrage_api.py b/lib/tvrage_api/tvrage_api.py
index 24bc2f9f..09943837 100644
--- a/lib/tvrage_api/tvrage_api.py
+++ b/lib/tvrage_api/tvrage_api.py
@@ -1,5 +1,5 @@
# !/usr/bin/env python2
-#encoding:utf-8
+# encoding:utf-8
#author:echel0n
#project:tvrage_api
#repository:http://github.com/echel0n/tvrage_api
@@ -393,7 +393,6 @@ class TVRage:
except ImportError:
return os.path.join(tempfile.gettempdir(), "tvrage_api")
-
return os.path.join(tempfile.gettempdir(), "tvrage_api-%s" % (uid))
#@retry(tvrage_error)
@@ -455,7 +454,7 @@ class TVRage:
if key == 'genre':
value = value['genre']
if not value:
- value=[]
+ value = []
if not isinstance(value, list):
value = [value]
value = filter(None, value)
@@ -470,9 +469,9 @@ class TVRage:
value = parse(value, fuzzy=True).date()
value = value.strftime("%Y-%m-%d")
- #if key == 'airs_time':
- # value = parse(value).time()
- # value = value.strftime("%I:%M %p")
+ #if key == 'airs_time':
+ # value = parse(value).time()
+ # value = value.strftime("%I:%M %p")
except:
pass
@@ -489,20 +488,10 @@ class TVRage:
"""
try:
- src = self._loadUrl(url, params)
- src = [src[item] for item in src][0] if src else []
+ src = self._loadUrl(url, params).values()[0]
+ return src
except:
- errormsg = "There was an error with the XML retrieved from tvrage.com"
-
- if self.config['cache_enabled']:
- errormsg += "\nFirst try emptying the cache folder at..\n%s" % (
- self.config['cache_location']
- )
-
- errormsg += "\nIf this does not resolve the issue, please try again later. If the error persists, report a bug on\n"
- raise tvrage_error(errormsg)
-
- return src
+ return []
def _setItem(self, sid, seas, ep, attrib, value):
"""Creates a new episode, creating Show(), Season() and
@@ -557,8 +546,12 @@ class TVRage:
series = series.encode("utf-8")
log().debug("Searching for show %s" % series)
self.config['params_getSeries']['show'] = series
- seriesEt = self._getetsrc(self.config['url_getSeries'], self.config['params_getSeries'])
- return [seriesEt[item] for item in seriesEt][0] if seriesEt else []
+
+ try:
+ seriesFound = self._getetsrc(self.config['url_getSeries'], self.config['params_getSeries']).values()[0]
+ return seriesFound
+ except:
+ return []
def _getSeries(self, series):
"""This searches tvrage.com for the series name,
@@ -632,7 +625,7 @@ class TVRage:
ep_no = int(episode['episodenumber'])
self._setItem(sid, seas_no, ep_no, 'seasonnumber', seas_no)
- for k,v in episode.items():
+ for k, v in episode.items():
try:
k = k.lower()
if v is not None:
diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py
index b50b40a6..f05bf557 100644
--- a/sickbeard/webserve.py
+++ b/sickbeard/webserve.py
@@ -1134,7 +1134,7 @@ class Manage(MainHandler):
redirect("/manage/")
- def massUpdate(self, toUpdate=None, toRefresh=None, toRename=None, toDelete=None, toMetadata=None, toSubtitle=None):
+ def massUpdate(self, toUpdate=None, toRefresh=None, toRename=None, toDelete=None, toRemove=None, toMetadata=None, toSubtitle=None):
if toUpdate is not None:
toUpdate = toUpdate.split('|')
@@ -1161,6 +1161,11 @@ class Manage(MainHandler):
else:
toDelete = []
+ if toRemove is not None:
+ toRemove = toRemove.split('|')
+ else:
+ toRemove = []
+
if toMetadata is not None:
toMetadata = toMetadata.split('|')
else:
@@ -1172,7 +1177,7 @@ class Manage(MainHandler):
renames = []
subtitles = []
- for curShowID in set(toUpdate + toRefresh + toRename + toSubtitle + toDelete + toMetadata):
+ for curShowID in set(toUpdate + toRefresh + toRename + toSubtitle + toDelete + toRemove + toMetadata):
if curShowID == '':
continue
@@ -1183,10 +1188,15 @@ class Manage(MainHandler):
continue
if curShowID in toDelete:
- showObj.deleteShow()
+ showObj.deleteShow(True)
# don't do anything else if it's being deleted
continue
+ if curShowID in toRemove:
+ showObj.deleteShow()
+ # don't do anything else if it's being remove
+ continue
+
if curShowID in toUpdate:
try:
sickbeard.showQueueScheduler.action.updateShow(showObj, True) # @UndefinedVariable