1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-11 03:45:01 -05:00

Merge remote-tracking branch 'origin/dev'

This commit is contained in:
echel0n 2014-06-25 21:41:03 -07:00
commit 303055c787
3 changed files with 8 additions and 7 deletions

View File

@ -267,7 +267,7 @@ class GenericProvider:
# remove duplicate items
searchItems[epObj] = itemList
#if we have cached results return them.
# if we have cached results return them.
if len(results):
return results
@ -321,11 +321,11 @@ class GenericProvider:
logger.DEBUG)
continue
airdate = parse_result.air_date.toordinal() if parse_result.air_date else parse_result.sports_event_date.toordinal()
myDB = db.DBConnection()
sql_results = myDB.select(
"SELECT season, episode FROM tv_episodes WHERE showid = ? AND airdate = ?",
[show.indexerid,
parse_result.air_date.toordinal() or parse_result.sports_event_date.toordinal()])
[show.indexerid, airdate])
if len(sql_results) != 1:
logger.log(

View File

@ -634,7 +634,7 @@ class TVShow(object):
logger.log(
u"Looks like this is an air-by-date or sports show, attempting to convert the date to season/episode",
logger.DEBUG)
airdate = parse_result.air_date.toordinal() or parse_result.sports_event_date.toordinal()
airdate = parse_result.air_date.toordinal() if parse_result.air_date else parse_result.sports_event_date.toordinal()
myDB = db.DBConnection()
sql_result = myDB.select(
"SELECT season, episode FROM tv_episodes WHERE showid = ? and indexer = ? and airdate = ?",

View File

@ -52,7 +52,8 @@ class CacheDBConnection(db.DBConnection):
# Create the table if it's not already there
try:
if not self.hasTable(providerName):
self.action("CREATE TABLE [" + providerName + "] (name TEXT, season NUMERIC, episodes TEXT, indexerid NUMERIC, url TEXT, time NUMERIC, quality TEXT)")
self.action(
"CREATE TABLE [" + providerName + "] (name TEXT, season NUMERIC, episodes TEXT, indexerid NUMERIC, url TEXT, time NUMERIC, quality TEXT)")
except Exception, e:
if str(e) != "table [" + providerName + "] already exists":
raise
@ -241,7 +242,7 @@ class TVCache():
def shouldUpdate(self):
# if we've updated recently then skip the update
#if datetime.datetime.today() - self.lastUpdate < datetime.timedelta(minutes=self.minTime):
# if datetime.datetime.today() - self.lastUpdate < datetime.timedelta(minutes=self.minTime):
# logger.log(u"Last update was too soon, using old cache: today()-" + str(self.lastUpdate) + "<" + str(
# datetime.timedelta(minutes=self.minTime)), logger.DEBUG)
# return False
@ -275,7 +276,7 @@ class TVCache():
season = episodes = None
if parse_result.air_by_date or parse_result.sports:
airdate = parse_result.air_date.toordinal() or parse_result.sports_event_date.toordinal()
airdate = parse_result.air_date.toordinal() if parse_result.air_date else parse_result.sports_event_date.toordinal()
myDB = db.DBConnection()
sql_results = myDB.select(