diff --git a/couchpotato/core/media/show/matcher/base.py b/couchpotato/core/media/show/matcher/base.py index 35829bc..488b191 100755 --- a/couchpotato/core/media/show/matcher/base.py +++ b/couchpotato/core/media/show/matcher/base.py @@ -6,26 +6,6 @@ log = CPLog(__name__) class Base(MatcherBase): - - # TODO come back to this later, think this could be handled better, this is starting to get out of hand.... - quality_map = { - 'bluray_1080p': {'resolution': ['1080p'], 'source': ['bluray']}, - 'bluray_720p': {'resolution': ['720p'], 'source': ['bluray']}, - - 'bdrip_1080p': {'resolution': ['1080p'], 'source': ['BDRip']}, - 'bdrip_720p': {'resolution': ['720p'], 'source': ['BDRip']}, - - 'brrip_1080p': {'resolution': ['1080p'], 'source': ['BRRip']}, - 'brrip_720p': {'resolution': ['720p'], 'source': ['BRRip']}, - - 'webdl_1080p': {'resolution': ['1080p'], 'source': ['webdl', ['web', 'dl']]}, - 'webdl_720p': {'resolution': ['720p'], 'source': ['webdl', ['web', 'dl']]}, - 'webdl_480p': {'resolution': ['480p'], 'source': ['webdl', ['web', 'dl']]}, - - 'hdtv_720p': {'resolution': ['720p'], 'source': ['hdtv']}, - 'hdtv_sd': {'resolution': ['480p', None], 'source': ['hdtv']}, - } - def __init__(self): super(Base, self).__init__() diff --git a/couchpotato/core/media/show/quality/main.py b/couchpotato/core/media/show/quality/main.py index 1d3b3c6..cd15ccd 100755 --- a/couchpotato/core/media/show/quality/main.py +++ b/couchpotato/core/media/show/quality/main.py @@ -49,6 +49,7 @@ class ShowQuality(QualityBase): # resolutions {'identifier': '1080p', 'label': '1080p', 'size': (800, 5000), 'codec': ['mp4-avc'], 'container': ['mpeg-ts', 'mkv'], 'resolution': ['1080p']}, {'identifier': '720p', 'label': '720p', 'size': (800, 5000), 'codec': ['mp4-avc'], 'container': ['mpeg-ts', 'mkv'], 'resolution': ['720p']}, + {'identifier': '480p', 'label': '480p', 'size': (800, 5000), 'codec': ['mp4-avc'], 'container': ['mpeg-ts', 'mkv'], 'resolution': ['480p']}, # sources {'identifier': 'cam', 'label': 'Cam', 'size': (800, 5000), 'source': ['cam']}, @@ -76,7 +77,6 @@ class ShowQuality(QualityBase): cache_key = str([f.replace('.' + getExt(f), '') if len(getExt(f)) < 4 else f for f in files]) cached = self.getCache(cache_key) if cached and len(extra) == 0: - log.debug('returning cache: %s', cached) return cached qualities = self.all() @@ -137,7 +137,7 @@ class ShowQuality(QualityBase): tuple([y.lower() for y in x]) if isinstance(x, list) else x.lower() - for x in info[key] + for x in info.get(key, []) ] found = False diff --git a/couchpotato/core/media/show/searcher/episode.py b/couchpotato/core/media/show/searcher/episode.py index fc7998d..ade2165 100755 --- a/couchpotato/core/media/show/searcher/episode.py +++ b/couchpotato/core/media/show/searcher/episode.py @@ -133,8 +133,7 @@ class EpisodeSearcher(SearcherBase, ShowTypeBase): log.info2('Too early to search for %s, %s', (too_early_to_search, query)) def correctRelease(self, release = None, media = None, quality = None, **kwargs): - if media.get('type') != 'show.episode': - return + if media.get('type') != 'show.episode': return retention = Env.setting('retention', section = 'nzb') diff --git a/couchpotato/core/media/show/searcher/season.py b/couchpotato/core/media/show/searcher/season.py index 1d382dc..17fc170 100755 --- a/couchpotato/core/media/show/searcher/season.py +++ b/couchpotato/core/media/show/searcher/season.py @@ -166,6 +166,14 @@ class SeasonSearcher(SearcherBase, ShowTypeBase): if not fireEvent('searcher.correct_words', release['name'], media, single = True): return False + preferred_quality = quality if quality else fireEvent('quality.single', identifier = quality['identifier'], single = True) + + # Contains lower quality string + contains_other = fireEvent('searcher.contains_other_quality', release, preferred_quality = preferred_quality, types = [self._type], single = True) + if contains_other != False: + log.info2('Wrong: %s, looking for %s, found %s', (release['name'], quality['label'], [x for x in contains_other] if contains_other else 'no quality')) + return False + # TODO Matching is quite costly, maybe we should be caching release matches somehow? (also look at caper optimizations) match = fireEvent('matcher.match', release, media, quality, single = True) if match: