Commit 92337a71 authored by echel0n's avatar echel0n
Browse files

Added code to cleanup cached provider results with UNKNOWN quality

Added code to prevent parsed search results with UNKNOWN quality from being cached
parent e6b81056
# Changelog
- * 3717a05 - 2017-12-14: Release v9.2.63
- * 0f01103 - 2017-12-15: Added code to cleanup cached provider results with UNKNOWN quality Added code to prevent parsed search results with UNKNOWN quality from being cached
- * 9d35ea1 - 2017-12-14: Release v9.2.63
- * 22c5664 - 2017-12-14: Fixed issue "Unable to contact theTVDB: [0]: Series result returned zero"
- * 20416e1 - 2017-12-13: Release v9.2.62
- * 34d3b93 - 2017-12-13: Added code to name cache to allow adding show names we wish to ignore, helps speed up name parsing and searches
......
......@@ -187,7 +187,7 @@ class TVCache(object):
try:
# parse release name
parse_result = NameParser(validate_show=sickrage.app.config.enable_rss_cache_valid_shows).parse(name)
if parse_result.series_name:
if parse_result.series_name and parse_result.quality != Quality.UNKNOWN:
season = parse_result.season_number if parse_result.season_number else 1
episodes = parse_result.episode_numbers
......
......@@ -21,6 +21,7 @@ from __future__ import unicode_literals
import os
import sickrage
from sickrage.core.common import Quality
from sickrage.core.databases import srDatabase
from sickrage.core.databases.cache.index import CacheLastUpdateIndex, CacheLastSearchIndex, CacheSceneExceptionsIndex, \
CacheSceneNamesIndex, CacheNetworkTimezonesIndex, CacheSceneExceptionsRefreshIndex, CacheProvidersIndex
......@@ -48,4 +49,12 @@ class CacheDB(srDatabase):
def __init__(self, name='cache'):
super(CacheDB, self).__init__(name)
self.old_db_path = os.path.join(sickrage.app.data_dir, 'cache.db')
\ No newline at end of file
self.old_db_path = os.path.join(sickrage.app.data_dir, 'cache.db')
def cleanup(self):
self.cleanup_provider_cache()
def cleanup_provider_cache(self):
for item in self.all('providers'):
if int(item["quality"]) == Quality.UNKNOWN:
self.delete(item)
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment