Merge pull request #2574 from fuzeman/tv_searcher

[TV] Matching, serialization and UI notification fixes
This commit is contained in:
Joel Kåberg
2013-12-06 03:18:04 -08:00
5 changed files with 23 additions and 6 deletions

View File

@@ -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)

View File

@@ -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()

View File

@@ -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 ['<name_one>', '<name_one> <suffix_one>', '<name_two>', ...])
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:

View File

@@ -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" % (

View File

@@ -85,9 +85,13 @@ PATTERN_GROUPS = [
(r'(?P<codec>%s)', [
'x264',
'XViD'
'XViD',
'H264'
]),
# For 'H 264' tags
('(?P<codec>H)', '(?P<codec>264)'),
(r'(?P<language>%s)', [
'GERMAN',
'DUTCH',