From 9496df9e9d09b3b3ea01813281e69ce67a3e4c62 Mon Sep 17 00:00:00 2001 From: Dean Gardiner Date: Fri, 6 Dec 2013 22:13:17 +1300 Subject: [PATCH 1/4] Fixed a bug where matching show names with a year would fail --- couchpotato/core/plugins/matcher/main.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/plugins/matcher/main.py b/couchpotato/core/plugins/matcher/main.py index 2260f9fc..30f679dd 100644 --- a/couchpotato/core/plugins/matcher/main.py +++ b/couchpotato/core/plugins/matcher/main.py @@ -89,11 +89,24 @@ class Matcher(Plugin): log.info('Wrong: missing show name in parsed result') return False + # Get the lower-case parsed show name from the chain chain_words = [x.lower() for x in chain.info['show_name']] + # Build a list of possible titles of the media we are searching for + titles = root_library['info']['titles'] + + # Add year suffix titles (will result in ['', ' ', '', ...]) + suffixes = [None, root_library['info']['year']] + + titles = [ + title + ((' %s' % suffix) if suffix else '') + for title in titles + for suffix in suffixes + ] + # Check show titles match # TODO check xem names - for title in root_library['info']['titles']: + for title in titles: for valid_words in [x.split(' ') for x in possibleTitles(title)]: if valid_words == chain_words: From 01e64e989e3823220a25a398df3eef545607dc13 Mon Sep 17 00:00:00 2001 From: Dean Gardiner Date: Fri, 6 Dec 2013 22:51:42 +1300 Subject: [PATCH 2/4] Updated Caper to v0.2.5 - fixes 'H 264' tag bug --- libs/caper/__init__.py | 2 +- libs/caper/parsers/scene.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/caper/__init__.py b/libs/caper/__init__.py index 0ebdccc8..2509c114 100644 --- a/libs/caper/__init__.py +++ b/libs/caper/__init__.py @@ -19,7 +19,7 @@ from caper.parsers.anime import AnimeParser from caper.parsers.scene import SceneParser -__version_info__ = ('0', '2', '4') +__version_info__ = ('0', '2', '5') __version_branch__ = 'master' __version__ = "%s%s" % ( diff --git a/libs/caper/parsers/scene.py b/libs/caper/parsers/scene.py index 44274ebc..764748da 100644 --- a/libs/caper/parsers/scene.py +++ b/libs/caper/parsers/scene.py @@ -85,9 +85,13 @@ PATTERN_GROUPS = [ (r'(?P%s)', [ 'x264', - 'XViD' + 'XViD', + 'H264' ]), + # For 'H 264' tags + ('(?PH)', '(?P264)'), + (r'(?P%s)', [ 'GERMAN', 'DUTCH', From afe9aed2eb555cebdeab924c090d19017e55204c Mon Sep 17 00:00:00 2001 From: Dean Gardiner Date: Fri, 6 Dec 2013 23:13:42 +1300 Subject: [PATCH 3/4] Fixed bug where media default_dict contained related and root library attributes. --- couchpotato/core/media/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/media/__init__.py b/couchpotato/core/media/__init__.py index 3894fbf8..d4d23c5a 100644 --- a/couchpotato/core/media/__init__.py +++ b/couchpotato/core/media/__init__.py @@ -18,12 +18,12 @@ class MediaBase(Plugin): 'category': {}, } - search_dict = mergeDicts(default_dict, { + search_dict = mergeDicts({ 'library': { 'related_libraries': {}, 'root_library': {} }, - }) + }, default_dict) def initType(self): addEvent('media.types', self.getType) From d8884bb6554b12ffba33208cec78deb985b279ea Mon Sep 17 00:00:00 2001 From: Dean Gardiner Date: Fri, 6 Dec 2013 23:55:04 +1300 Subject: [PATCH 4/4] Changed '.searcher.single' call to use search_dict for media serialization --- couchpotato/core/media/movie/_base/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/couchpotato/core/media/movie/_base/main.py b/couchpotato/core/media/movie/_base/main.py index 20663b59..819e2edc 100644 --- a/couchpotato/core/media/movie/_base/main.py +++ b/couchpotato/core/media/movie/_base/main.py @@ -175,7 +175,7 @@ class MovieBase(MovieTypeBase): fireEvent('media.restatus', m.id) - movie_dict = m.to_dict(self.default_dict) + movie_dict = m.to_dict(self.search_dict) fireEventAsync('movie.searcher.single', movie_dict, on_complete = self.createNotifyFront(media_id)) db.expire_all()