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

@ -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
@ -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(