diff --git a/sickbeard/name_parser/regexes.py b/sickbeard/name_parser/regexes.py index 91def594..d76ed2ae 100644 --- a/sickbeard/name_parser/regexes.py +++ b/sickbeard/name_parser/regexes.py @@ -190,7 +190,7 @@ sports_regexs = [ ('sports_event', # Show.Name.123.Event.Nov.23rd.2010.Source.Quality.Etc-Group ''' - ^((?P.+?)[. _-]+)? +/////////////////////p,.l.................. ^((?P.+?)[. _-]+)? ((?P\d{1,2}).+)[. _-]+ (?P\w{3,})[. _-]+ (?P\d{4}) diff --git a/sickbeard/tvcache.py b/sickbeard/tvcache.py index 4b1e9594..47357937 100644 --- a/sickbeard/tvcache.py +++ b/sickbeard/tvcache.py @@ -56,18 +56,13 @@ class CacheDBConnection(db.DBConnection): if str(e) != "table lastUpdate already exists": raise - # Delete any entries missing a Indexer ID + # Clear out records missing there Indexer IDs try: - sqlResults = self.connection.execute( - "SELECT * FROM [" + providerName + "] WHERE indexerid is NULL OR indexerid = 0") - for cur_orphan in sqlResults: - logger.log(u"Missing IndexerID detected! name: " + str(cur_orphan["name"]), logger.DEBUG) - logger.log(u"Deleting orphaned cache entry with name: " + str(cur_orphan["name"])) - self.connection.action("DELETE FROM [" + providerName + "] WHERE name = ?", [cur_orphan["name"]]) - except sqlite3.OperationalError, e: - if str(e) != "table [" + providerName + "] cleanup failed": - raise - + sql = "DELETE FROM [" + providerName + "] WHERE indexerid is NULL or indexerid is 0" + self.connection.execute(sql) + self.connection.commit() + except: + pass class TVCache(): def __init__(self, provider):