Private GIT

Skip to content
Snippets Groups Projects
Commit 6f299d73 authored by Nic Wolfe's avatar Nic Wolfe
Browse files

Made some slight changes to the BTN api code

parent b4741e7d
Branches
Tags
No related merge requests found
......@@ -199,7 +199,7 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#;
<div class="field-pair">
<label class="clearfix">
<span class="component-title">BTN API KEY:</span>
<input class="component-desc" type="text" name="btn_api_key" value="$sickbeard.BTN_API_KEY" />
<input class="component-desc" type="text" name="btn_api_key" value="$sickbeard.BTN_API_KEY" size="40" />
</label>
</div>
</div>
......
......@@ -25,7 +25,7 @@ from sickbeard import logger
from sickbeard import tvcache
from sickbeard.helpers import sanitizeSceneName
from sickbeard.common import Quality
from sickbeard.exceptions import ex
from sickbeard.exceptions import ex, AuthException
from lib import jsonrpclib
import datetime
......@@ -102,7 +102,7 @@ class BTNProvider(generic.TorrentProvider):
(title, url) = self._get_title_and_url(torrent_info)
if not title or not url:
logger.log(u"The BTN provider did not return both a valid title and URL for search parameters: " + str(params) + " but returned " + str(torrentinfo), logger.WARNING)
logger.log(u"The BTN provider did not return both a valid title and URL for search parameters: " + str(params) + " but returned " + str(torrent_info), logger.WARNING)
results.append(torrent_info)
# Disabled this because it overspammed the debug log a bit too much
......@@ -290,7 +290,7 @@ class BTNCache(tvcache.TVCache):
self._clearCache()
if not self._checkAuth(data):
raise exceptions.AuthException("Your authentication info for "+self.provider.name+" is incorrect, check your config")
raise AuthException("Your authentication info for "+self.provider.name+" is incorrect, check your config")
# By now we know we've got data and no auth errors, all we need to do is put it in the database
for item in data:
......
......@@ -33,9 +33,11 @@ from sickbeard import notifiers
from sickbeard import nzbSplitter
from sickbeard import ui
from sickbeard import encodingKludge as ek
from sickbeard.exceptions import ex
from sickbeard import providers
from sickbeard.exceptions import ex
from sickbeard.providers.generic import GenericProvider
def _downloadResult(result):
"""
Downloads a result to the appropriate black hole folder.
......@@ -395,8 +397,7 @@ def findSeason(show, season):
else:
# Check if the provider of this NZB is BTN, if so it's not a NZB but a torrent so all we can do is leach the entire torrent, user will have to select which eps not do download in his torrent client
if not 'BTN' in bestSeasonNZB.provider.name:
if bestSeasonNZB.provider.providerType == GenericProvider.NZB:
logger.log(u"Breaking apart the NZB and adding the individual ones to our results", logger.DEBUG)
# if not, break it apart and add them as the lowest priority results
......@@ -414,7 +415,10 @@ def findSeason(show, season):
foundResults[epNum].append(curResult)
else:
foundResults[epNum] = [curResult]
# If this is a torrent all we can do is leech the entire torrent, user will have to select which eps not do download in his torrent client
else:
# Season result from BTN must be a full-season torrent, creating multi-ep result for it.
logger.log(u"Adding multi-ep result for full-season torrent. Set the episodes you don't want to 'don't download' in your torrent client if desired!")
epObjs = []
......@@ -469,7 +473,7 @@ def findSeason(show, season):
logger.log(u"Multi-ep check result is multiNeededEps: "+str(multiNeededEps)+", multiNotNeededEps: "+str(multiNotNeededEps), logger.DEBUG)
if not neededEps:
if not multiNeededEps:
logger.log(u"All of these episodes were covered by another multi-episode nzbs, ignoring this multi-ep result", logger.DEBUG)
continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment