1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Merge remote-tracking branch 'origin/dev'

This commit is contained in:
echel0n 2014-07-02 13:43:47 -07:00
commit 847a172462
4 changed files with 27 additions and 27 deletions

View File

@ -298,8 +298,7 @@ def searchDBForShow(regShowName, log=False):
[showName])
if len(sqlResults) == 1:
return (int(sqlResults[0]["indexer_id"]), sqlResults[0]["show_name"])
return int(sqlResults[0]["indexer_id"])
else:
# if we didn't get exactly one result then try again with the year stripped off if possible
match = re.match(yearRegex, showName)
@ -321,10 +320,7 @@ def searchDBForShow(regShowName, log=False):
logger.DEBUG)
continue
else:
return (int(sqlResults[0]["indexer_id"]), sqlResults[0]["show_name"])
return
return int(sqlResults[0]["indexer_id"])
def searchIndexerForShowID(regShowName, indexer=None, indexer_id=None, ui=None):
showNames = [re.sub('[. -]', ' ', regShowName)]
@ -1077,10 +1073,16 @@ def get_show_by_name(name, useIndexer=False):
showObj = sickbeard.name_cache.retrieveShowFromCache(name)
if showObj:
return showObj
if not showObj and sickbeard.showList:
scene_indexerid, scene_season = sickbeard.scene_exceptions.get_scene_exception_by_name(name)
if scene_indexerid:
showObj = findCertainShow(sickbeard.showList, scene_indexerid)
db_indexerid = searchDBForShow(name)
if db_indexerid:
showObj = findCertainShow(sickbeard.showList, db_indexerid)
if not showObj:
scene_indexerid, scene_season = sickbeard.scene_exceptions.get_scene_exception_by_name(name)
if scene_indexerid:
showObj = findCertainShow(sickbeard.showList, scene_indexerid)
if useIndexer and not showObj:
(sn, idx, id) = searchIndexerForShowID(name, ui=classes.ShowListUI)

View File

@ -57,8 +57,8 @@ class HDTorrentsProvider(generic.TorrentProvider):
self.supportsBacklog = True
self.enabled = False
self.uid = None
self.hash = None
self._uid = None
self._hash = None
self.username = None
self.password = None
self.ratio = None
@ -92,7 +92,7 @@ class HDTorrentsProvider(generic.TorrentProvider):
if any(requests.utils.dict_from_cookiejar(self.session.cookies).values()):
return True
if self.uid and self.hash:
if self._uid and self._hash:
requests.utils.add_dict_to_cookiejar(self.session.cookies, self.cookies)
@ -114,11 +114,11 @@ class HDTorrentsProvider(generic.TorrentProvider):
logger.log(u'Invalid username or password for ' + self.name + ' Check your settings', logger.ERROR)
return False
self.uid = requests.utils.dict_from_cookiejar(self.session.cookies)['uid']
self.hash = requests.utils.dict_from_cookiejar(self.session.cookies)['pass']
self._uid = requests.utils.dict_from_cookiejar(self.session.cookies)['uid']
self._hash = requests.utils.dict_from_cookiejar(self.session.cookies)['pass']
self.cookies = {'uid': self.uid,
'pass': self.hash
self.cookies = {'uid': self._uid,
'pass': self._hash
}
return True

View File

@ -180,11 +180,9 @@ class ThePirateBayProvider(generic.TorrentProvider):
ep_string = show_name + ' ' + "%d" % ep_obj.scene_absolute_number
search_string['Season'].append(ep_string)
else:
ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) + ' -S%02d' % int(
ep_obj.scene_season) + 'E' + ' category:tv' #1) showName SXX -SXXE
ep_string = show_name + ' S%02d' % int(ep_obj.scene_season)
search_string['Season'].append(ep_string)
ep_string = show_name + ' Season ' + str(
ep_obj.scene_season) + ' -Ep*' + ' category:tv' # 2) showName Season X
ep_string = show_name + ' Season ' + str(ep_obj.scene_season) + ' -Ep*'
search_string['Season'].append(ep_string)
search_string['Season'].append(ep_string)

View File

@ -54,8 +54,8 @@ class TorrentDayProvider(generic.TorrentProvider):
self.supportsBacklog = True
self.enabled = False
self.uid = None
self.hash = None
self._uid = None
self._hash = None
self.username = None
self.password = None
self.ratio = None
@ -91,7 +91,7 @@ class TorrentDayProvider(generic.TorrentProvider):
if any(requests.utils.dict_from_cookiejar(self.session.cookies).values()):
return True
if self.uid and self.hash:
if self._uid and self._hash:
requests.utils.add_dict_to_cookiejar(self.session.cookies, self.cookies)
@ -118,11 +118,11 @@ class TorrentDayProvider(generic.TorrentProvider):
return False
if requests.utils.dict_from_cookiejar(self.session.cookies)['uid'] and requests.utils.dict_from_cookiejar(self.session.cookies)['pass']:
self.uid = requests.utils.dict_from_cookiejar(self.session.cookies)['uid']
self.hash = requests.utils.dict_from_cookiejar(self.session.cookies)['pass']
self._uid = requests.utils.dict_from_cookiejar(self.session.cookies)['uid']
self._hash = requests.utils.dict_from_cookiejar(self.session.cookies)['pass']
self.cookies = {'uid': self.uid,
'pass': self.hash
self.cookies = {'uid': self._uid,
'pass': self._hash
}
return True