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

Fix for indexerid issues with cache.

Fix for regex matching.
This commit is contained in:
echel0n 2014-04-29 15:14:03 -07:00
parent 50b792d6df
commit 19cf543693
2 changed files with 7 additions and 12 deletions

View File

@ -190,7 +190,7 @@ sports_regexs = [
('sports_event', ('sports_event',
# Show.Name.123.Event.Nov.23rd.2010.Source.Quality.Etc-Group # Show.Name.123.Event.Nov.23rd.2010.Source.Quality.Etc-Group
''' '''
^((?P<series_name>.+?)[. _-]+)? /////////////////////p,.l.................. ^((?P<series_name>.+?)[. _-]+)?
((?P<air_day>\d{1,2}).+)[. _-]+ ((?P<air_day>\d{1,2}).+)[. _-]+
(?P<air_month>\w{3,})[. _-]+ (?P<air_month>\w{3,})[. _-]+
(?P<air_year>\d{4}) (?P<air_year>\d{4})

View File

@ -56,18 +56,13 @@ class CacheDBConnection(db.DBConnection):
if str(e) != "table lastUpdate already exists": if str(e) != "table lastUpdate already exists":
raise raise
# Delete any entries missing a Indexer ID # Clear out records missing there Indexer IDs
try: try:
sqlResults = self.connection.execute( sql = "DELETE FROM [" + providerName + "] WHERE indexerid is NULL or indexerid is 0"
"SELECT * FROM [" + providerName + "] WHERE indexerid is NULL OR indexerid = 0") self.connection.execute(sql)
for cur_orphan in sqlResults: self.connection.commit()
logger.log(u"Missing IndexerID detected! name: " + str(cur_orphan["name"]), logger.DEBUG) except:
logger.log(u"Deleting orphaned cache entry with name: " + str(cur_orphan["name"])) pass
self.connection.action("DELETE FROM [" + providerName + "] WHERE name = ?", [cur_orphan["name"]])
except sqlite3.OperationalError, e:
if str(e) != "table [" + providerName + "] cleanup failed":
raise
class TVCache(): class TVCache():
def __init__(self, provider): def __init__(self, provider):