mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-07 02:23:38 +00:00
Merge remote-tracking branch 'origin/dev'
This commit is contained in:
commit
847a172462
4 changed files with 27 additions and 27 deletions
|
@ -298,8 +298,7 @@ def searchDBForShow(regShowName, log=False):
|
||||||
[showName])
|
[showName])
|
||||||
|
|
||||||
if len(sqlResults) == 1:
|
if len(sqlResults) == 1:
|
||||||
return (int(sqlResults[0]["indexer_id"]), sqlResults[0]["show_name"])
|
return int(sqlResults[0]["indexer_id"])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# if we didn't get exactly one result then try again with the year stripped off if possible
|
# if we didn't get exactly one result then try again with the year stripped off if possible
|
||||||
match = re.match(yearRegex, showName)
|
match = re.match(yearRegex, showName)
|
||||||
|
@ -321,10 +320,7 @@ def searchDBForShow(regShowName, log=False):
|
||||||
logger.DEBUG)
|
logger.DEBUG)
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
return (int(sqlResults[0]["indexer_id"]), sqlResults[0]["show_name"])
|
return int(sqlResults[0]["indexer_id"])
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
def searchIndexerForShowID(regShowName, indexer=None, indexer_id=None, ui=None):
|
def searchIndexerForShowID(regShowName, indexer=None, indexer_id=None, ui=None):
|
||||||
showNames = [re.sub('[. -]', ' ', regShowName)]
|
showNames = [re.sub('[. -]', ' ', regShowName)]
|
||||||
|
@ -1077,10 +1073,16 @@ def get_show_by_name(name, useIndexer=False):
|
||||||
showObj = sickbeard.name_cache.retrieveShowFromCache(name)
|
showObj = sickbeard.name_cache.retrieveShowFromCache(name)
|
||||||
if showObj:
|
if showObj:
|
||||||
return showObj
|
return showObj
|
||||||
|
|
||||||
if not showObj and sickbeard.showList:
|
if not showObj and sickbeard.showList:
|
||||||
scene_indexerid, scene_season = sickbeard.scene_exceptions.get_scene_exception_by_name(name)
|
db_indexerid = searchDBForShow(name)
|
||||||
if scene_indexerid:
|
if db_indexerid:
|
||||||
showObj = findCertainShow(sickbeard.showList, scene_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:
|
if useIndexer and not showObj:
|
||||||
(sn, idx, id) = searchIndexerForShowID(name, ui=classes.ShowListUI)
|
(sn, idx, id) = searchIndexerForShowID(name, ui=classes.ShowListUI)
|
||||||
|
|
|
@ -57,8 +57,8 @@ class HDTorrentsProvider(generic.TorrentProvider):
|
||||||
self.supportsBacklog = True
|
self.supportsBacklog = True
|
||||||
|
|
||||||
self.enabled = False
|
self.enabled = False
|
||||||
self.uid = None
|
self._uid = None
|
||||||
self.hash = None
|
self._hash = None
|
||||||
self.username = None
|
self.username = None
|
||||||
self.password = None
|
self.password = None
|
||||||
self.ratio = None
|
self.ratio = None
|
||||||
|
@ -92,7 +92,7 @@ class HDTorrentsProvider(generic.TorrentProvider):
|
||||||
if any(requests.utils.dict_from_cookiejar(self.session.cookies).values()):
|
if any(requests.utils.dict_from_cookiejar(self.session.cookies).values()):
|
||||||
return True
|
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)
|
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)
|
logger.log(u'Invalid username or password for ' + self.name + ' Check your settings', logger.ERROR)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
self.uid = requests.utils.dict_from_cookiejar(self.session.cookies)['uid']
|
self._uid = requests.utils.dict_from_cookiejar(self.session.cookies)['uid']
|
||||||
self.hash = requests.utils.dict_from_cookiejar(self.session.cookies)['pass']
|
self._hash = requests.utils.dict_from_cookiejar(self.session.cookies)['pass']
|
||||||
|
|
||||||
self.cookies = {'uid': self.uid,
|
self.cookies = {'uid': self._uid,
|
||||||
'pass': self.hash
|
'pass': self._hash
|
||||||
}
|
}
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -180,11 +180,9 @@ class ThePirateBayProvider(generic.TorrentProvider):
|
||||||
ep_string = show_name + ' ' + "%d" % ep_obj.scene_absolute_number
|
ep_string = show_name + ' ' + "%d" % ep_obj.scene_absolute_number
|
||||||
search_string['Season'].append(ep_string)
|
search_string['Season'].append(ep_string)
|
||||||
else:
|
else:
|
||||||
ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) + ' -S%02d' % int(
|
ep_string = show_name + ' S%02d' % int(ep_obj.scene_season)
|
||||||
ep_obj.scene_season) + 'E' + ' category:tv' #1) showName SXX -SXXE
|
|
||||||
search_string['Season'].append(ep_string)
|
search_string['Season'].append(ep_string)
|
||||||
ep_string = show_name + ' Season ' + str(
|
ep_string = show_name + ' Season ' + str(ep_obj.scene_season) + ' -Ep*'
|
||||||
ep_obj.scene_season) + ' -Ep*' + ' category:tv' # 2) showName Season X
|
|
||||||
search_string['Season'].append(ep_string)
|
search_string['Season'].append(ep_string)
|
||||||
|
|
||||||
search_string['Season'].append(ep_string)
|
search_string['Season'].append(ep_string)
|
||||||
|
|
|
@ -54,8 +54,8 @@ class TorrentDayProvider(generic.TorrentProvider):
|
||||||
self.supportsBacklog = True
|
self.supportsBacklog = True
|
||||||
|
|
||||||
self.enabled = False
|
self.enabled = False
|
||||||
self.uid = None
|
self._uid = None
|
||||||
self.hash = None
|
self._hash = None
|
||||||
self.username = None
|
self.username = None
|
||||||
self.password = None
|
self.password = None
|
||||||
self.ratio = None
|
self.ratio = None
|
||||||
|
@ -91,7 +91,7 @@ class TorrentDayProvider(generic.TorrentProvider):
|
||||||
if any(requests.utils.dict_from_cookiejar(self.session.cookies).values()):
|
if any(requests.utils.dict_from_cookiejar(self.session.cookies).values()):
|
||||||
return True
|
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)
|
requests.utils.add_dict_to_cookiejar(self.session.cookies, self.cookies)
|
||||||
|
|
||||||
|
@ -118,11 +118,11 @@ class TorrentDayProvider(generic.TorrentProvider):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if requests.utils.dict_from_cookiejar(self.session.cookies)['uid'] and requests.utils.dict_from_cookiejar(self.session.cookies)['pass']:
|
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._uid = requests.utils.dict_from_cookiejar(self.session.cookies)['uid']
|
||||||
self.hash = requests.utils.dict_from_cookiejar(self.session.cookies)['pass']
|
self._hash = requests.utils.dict_from_cookiejar(self.session.cookies)['pass']
|
||||||
|
|
||||||
self.cookies = {'uid': self.uid,
|
self.cookies = {'uid': self._uid,
|
||||||
'pass': self.hash
|
'pass': self._hash
|
||||||
}
|
}
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue