예제 #1
0
 def _parse_title(entry):
     parser = plugin.get('parsing',
                         'movie_list').parse_movie(data=entry['title'])
     if parser and parser.valid:
         parser.name = plugin_parser_common.normalize_name(
             plugin_parser_common.remove_dirt(parser.name))
         entry.update(parser.fields)
예제 #2
0
 def _parse_title(entry):
     parser = plugin.get('parsing', 'movie_list').parse_movie(data=entry['title'])
     if parser and parser.valid:
         parser.name = plugin_parser_common.normalize_name(
             plugin_parser_common.remove_dirt(parser.name)
         )
         entry.update(parser.fields)
예제 #3
0
 def guess_entry(entry):
     """
     Populates movie_* fields for entries that are successfully parsed.
     :param entry: Entry that's being processed
     :return: True for successful parse
     """
     if entry.get('movie_guessed'):
         # Return true if we already parsed this
         return True
     parser = plugin.get('parsing',
                         'metainfo_movie').parse_movie(data=entry['title'])
     if parser and parser.valid:
         parser.name = plugin_parser_common.normalize_name(
             plugin_parser_common.remove_dirt(parser.name))
         for field, value in parser.fields.items():
             if not entry.is_lazy(field) and not entry.get(field):
                 entry[field] = value
         return True
     return False
예제 #4
0
 def guess_entry(entry):
     """
     Populates movie_* fields for entries that are successfully parsed.
     :param entry: Entry that's being processed
     :return: True for successful parse
     """
     if entry.get('movie_guessed'):
         # Return true if we already parsed this
         return True
     parser = plugin.get('parsing', 'metainfo_movie').parse_movie(data=entry['title'])
     if parser and parser.valid:
         parser.name = plugin_parser_common.normalize_name(
             plugin_parser_common.remove_dirt(parser.name)
         )
         for field, value in parser.fields.items():
             if not entry.is_lazy(field) and not entry.get(field):
                 entry[field] = value
         return True
     return False
예제 #5
0
    def guess_entry(self, entry, allow_seasonless=False, config=None):
        """
        Populates series_* fields for entries that are successfully parsed.

        :param dict config: A series config to be used. This will also cause 'path' and 'set' fields to be populated.
        """
        if entry.get('series_parser') and entry['series_parser'].valid:
            # Return true if we already parsed this, false if series plugin parsed it
            return True
        identified_by = 'auto'
        if config and 'identified_by' in config:
            identified_by = config['identified_by']
        parsed = plugin.get('parsing', self).parse_series(
            data=entry['title'],
            identified_by=identified_by,
            allow_seasonless=allow_seasonless)
        if parsed and parsed.valid:
            parsed.name = plugin_parser_common.normalize_name(
                plugin_parser_common.remove_dirt(parsed.name))
            plugin_series.populate_entry_fields(entry, parsed, config)
            entry['series_guessed'] = True
            return True
        return False