Merge branch 'hotfix/0.8.3'

This commit is contained in:
Adam 2015-04-25 16:48:36 +08:00
commit 7e2a8f7b66
7 changed files with 21 additions and 3 deletions

View file

@ -1,3 +1,8 @@
### 0.8.3 (2015-04-25 08:48:00 UTC)
* Fix clearing of the provider cache
### 0.8.2 (2015-04-19 06:45:00 UTC)
* Fix IPTorrents provider search strings and URL for new site changes

View file

@ -1439,3 +1439,10 @@ def check_port(host, port, timeout=1.0):
except socket.error:
if s:
s.close()
def clear_unused_providers():
providers = [x.cache.providerID for x in sickbeard.providers.sortedProviderList() if x.isActive()]
if providers:
myDB = db.DBConnection('cache.db')
myDB.action('DELETE FROM provider_cache WHERE provider NOT IN (%s)' % ','.join(['?'] * len(providers)), providers)

View file

@ -439,11 +439,11 @@ class NewznabCache(tvcache.TVCache):
if not data:
return []
self.setLastUpdate()
# clear cache
self._clearCache()
self.setLastUpdate()
if self._checkAuth(data):
items = data.entries
cl = []

View file

@ -462,7 +462,7 @@ def searchProviders(show, episodes, manualSearch=False):
logger.log(u"Performing season pack search for " + show.name)
try:
curProvider.cache.updateCache()
curProvider.cache._clearCache()
searchResults = curProvider.findSearchResults(show, episodes, search_mode, manualSearch)
except exceptions.AuthException, e:
logger.log(u"Authentication error: " + ex(e), logger.ERROR)

View file

@ -44,6 +44,9 @@ class ShowUpdater():
if sickbeard.USE_FAILED_DOWNLOADS:
failed_history.trimHistory()
# clear the data of unused providers
sickbeard.helpers.clear_unused_providers()
logger.log(u"Doing full update on all shows")
# clean out cache directory, remove everything > 12 hours old

View file

@ -284,6 +284,7 @@ class TVCache():
sqlResults = list(itertools.chain(*sqlResults))
if not sqlResults:
self.setLastSearch()
return neededEps
# for each cache entry

View file

@ -4263,6 +4263,8 @@ class ConfigProviders(Config):
sickbeard.NEWZNAB_DATA = '!!!'.join([x.configStr() for x in sickbeard.newznabProviderList])
sickbeard.PROVIDER_ORDER = provider_list
helpers.clear_unused_providers()
sickbeard.save_config()
if len(results) > 0: