mirror of
https://github.com/moparisthebest/SickRage
synced 2024-11-17 06:45:05 -05:00
Fix for ABD and Sports shows issue with toordinal function.
This commit is contained in:
parent
39f32b3b7c
commit
e0eea79ec5
@ -321,11 +321,11 @@ class GenericProvider:
|
|||||||
logger.DEBUG)
|
logger.DEBUG)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
airdate = parse_result.air_date.toordinal() if parse_result.air_date else parse_result.sports_event_date.toordinal()
|
||||||
myDB = db.DBConnection()
|
myDB = db.DBConnection()
|
||||||
sql_results = myDB.select(
|
sql_results = myDB.select(
|
||||||
"SELECT season, episode FROM tv_episodes WHERE showid = ? AND airdate = ?",
|
"SELECT season, episode FROM tv_episodes WHERE showid = ? AND airdate = ?",
|
||||||
[show.indexerid,
|
[show.indexerid, airdate])
|
||||||
parse_result.air_date.toordinal() or parse_result.sports_event_date.toordinal()])
|
|
||||||
|
|
||||||
if len(sql_results) != 1:
|
if len(sql_results) != 1:
|
||||||
logger.log(
|
logger.log(
|
||||||
|
@ -634,7 +634,7 @@ class TVShow(object):
|
|||||||
logger.log(
|
logger.log(
|
||||||
u"Looks like this is an air-by-date or sports show, attempting to convert the date to season/episode",
|
u"Looks like this is an air-by-date or sports show, attempting to convert the date to season/episode",
|
||||||
logger.DEBUG)
|
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()
|
myDB = db.DBConnection()
|
||||||
sql_result = myDB.select(
|
sql_result = myDB.select(
|
||||||
"SELECT season, episode FROM tv_episodes WHERE showid = ? and indexer = ? and airdate = ?",
|
"SELECT season, episode FROM tv_episodes WHERE showid = ? and indexer = ? and airdate = ?",
|
||||||
|
@ -52,7 +52,8 @@ class CacheDBConnection(db.DBConnection):
|
|||||||
# Create the table if it's not already there
|
# Create the table if it's not already there
|
||||||
try:
|
try:
|
||||||
if not self.hasTable(providerName):
|
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:
|
except Exception, e:
|
||||||
if str(e) != "table [" + providerName + "] already exists":
|
if str(e) != "table [" + providerName + "] already exists":
|
||||||
raise
|
raise
|
||||||
@ -275,7 +276,7 @@ class TVCache():
|
|||||||
|
|
||||||
season = episodes = None
|
season = episodes = None
|
||||||
if parse_result.air_by_date or parse_result.sports:
|
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()
|
myDB = db.DBConnection()
|
||||||
sql_results = myDB.select(
|
sql_results = myDB.select(
|
||||||
|
Loading…
Reference in New Issue
Block a user