Fix for search provider config page errors.

This commit is contained in:
echel0n 2014-07-11 14:57:49 -07:00
parent 9e365310b6
commit 2d87de0fd8
2 changed files with 8 additions and 12 deletions

View file

@ -116,13 +116,12 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#;
<span class="component-desc"> <span class="component-desc">
#set $provider_config_list = [] #set $provider_config_list = []
#for $curProvider in $sickbeard.providers.sortedProviderList(): #for $curProvider in $sickbeard.providers.sortedProviderList():
#set $cur_provider_obj = $sickbeard.providers.getProviderClass($curProvider.getID()) #if $curProvider.providerType == $GenericProvider.NZB and not $sickbeard.USE_NZBS:
#if $cur_provider_obj.providerType == $GenericProvider.NZB and not $sickbeard.USE_NZBS:
#continue #continue
#elif $cur_provider_obj.providerType == $GenericProvider.TORRENT and not $sickbeard.USE_TORRENTS: #elif $curProvider.providerType == $GenericProvider.TORRENT and not $sickbeard.USE_TORRENTS:
#continue #continue
#end if #end if
$provider_config_list.append($cur_provider_obj) $provider_config_list.append($curProvider)
#end for #end for
#if $provider_config_list: #if $provider_config_list:

View file

@ -11,7 +11,7 @@
# SickRage is distributed in the hope that it will be useful, # SickRage is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with SickRage. If not, see <http://www.gnu.org/licenses/>. # along with SickRage. If not, see <http://www.gnu.org/licenses/>.
@ -94,8 +94,7 @@ class TorrentBytesProvider(generic.TorrentProvider):
return False return False
if re.search('Username or password incorrect', response.text): if re.search('Username or password incorrect', response.text):
logger.log(u'Invalid username or password for ' + self.name + ' Check your settings', logger.ERROR)
logger.log(u'Invalid username or password for ' + self.name + ' Check your settings', logger.ERROR)
return False return False
return True return True
@ -185,11 +184,11 @@ class TorrentBytesProvider(generic.TorrentProvider):
for result in torrent_rows[1:]: for result in torrent_rows[1:]:
cells = result.find_all('td') cells = result.find_all('td')
link = cells[1].find('a', attrs = {'class': 'index'}) link = cells[1].find('a', attrs={'class': 'index'})
full_id = link['href'].replace('details.php?id=', '') full_id = link['href'].replace('details.php?id=', '')
torrent_id = full_id[:6] torrent_id = full_id[:6]
try: try:
if link.has_key('title'): if link.has_key('title'):
title = cells[1].find('a', {'class': 'index'})['title'] title = cells[1].find('a', {'class': 'index'})['title']
@ -325,8 +324,6 @@ class TorrentBytesCache(tvcache.TVCache):
if ci is not None: if ci is not None:
cl.append(ci) cl.append(ci)
if cl: if cl:
myDB = self._getDB() myDB = self._getDB()
myDB.mass_action(cl) myDB.mass_action(cl)
@ -339,7 +336,7 @@ class TorrentBytesCache(tvcache.TVCache):
if not title or not url: if not title or not url:
return None return None
logger.log(u"Attempting to cache item:[" + title +"]", logger.DEBUG) logger.log(u"Attempting to cache item:[" + title + "]", logger.DEBUG)
return self._addCacheEntry(title, url) return self._addCacheEntry(title, url)