Example #1
0
    def guess_series(self, title, allow_seasonless=False, quality=None):
        """Returns a valid series parser if this `title` appears to be a series"""

        parsed = get_plugin_by_name('parsing').instance.parse_series(data=title, name=title, identified_by='auto', allow_seasonless=allow_seasonless, metainfo=True)
        if parsed and parsed.valid:
            # Normalizing name.
            # todo: Why only in metainfo series, and not other series plugin ?
            parsed.name = remove_dirt(parsed.name)
            parsed.name = normalize_name(parsed.name)
            return parsed
Example #2
0
 def guess_entry(self, entry, allow_seasonless=False):
     """Populates series_* fields for entries that are successfully parsed."""
     if entry.get('series_parser') and entry['series_parser'].valid:
         # Return true if we already parsed this, false if series plugin parsed it
         return entry.get('series_guessed')
     parsed = get_plugin_by_name('parsing').instance.parse_series(data=entry['title'], identified_by='auto',
                                                                  allow_seasonless=allow_seasonless)
     if parsed and parsed.valid:
         parsed.name = normalize_name(remove_dirt(parsed.name))
         populate_entry_fields(entry, parsed)
         entry['series_guessed'] = True
         return True
     return False
Example #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 = get_plugin_by_name('parsing').instance.parse_movie(data=entry['title'])
     if parser and parser.valid:
         parser.name = normalize_name(remove_dirt(parser.name))
         entry.update(parser.fields)
         return True
     return False
Example #4
0
 def guess_entry(self, entry, allow_seasonless=False):
     """Populates series_* fields for entries that are successfully parsed."""
     if entry.get('series_parser') and entry['series_parser'].valid:
         # Return true if we already parsed this, false if series plugin parsed it
         return entry.get('series_guessed')
     parsed = get_plugin_by_name('parsing').instance.parse_series(
         data=entry['title'],
         identified_by='auto',
         allow_seasonless=allow_seasonless)
     if parsed and parsed.valid:
         parsed.name = normalize_name(remove_dirt(parsed.name))
         populate_entry_fields(entry, parsed)
         entry['series_guessed'] = True
         return True
     return False
Example #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
        parsed = get_plugin_by_name('parsing').instance.parse_series(data=entry['title'], identified_by='auto',
                                                                     allow_seasonless=allow_seasonless)
        if parsed and parsed.valid:
            parsed.name = normalize_name(remove_dirt(parsed.name))
            populate_entry_fields(entry, parsed, config)
            entry['series_guessed'] = True
            return True
        return False
Example #6
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 = get_plugin_by_name('parsing').instance.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
Example #7
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
        parsed = get_plugin_by_name('parsing').instance.parse_series(
            data=entry['title'],
            identified_by='auto',
            allow_seasonless=allow_seasonless)
        if parsed and parsed.valid:
            parsed.name = normalize_name(remove_dirt(parsed.name))
            populate_entry_fields(entry, parsed, config)
            entry['series_guessed'] = True
            return True
        return False
Example #8
0
 def _parse_title(entry):
     parser = get_plugin_by_name('parsing').instance.parse_movie(data=entry['title'])
     if parser and parser.valid:
         parser.name = normalize_name(remove_dirt(parser.name))
         entry.update(parser.fields)
Example #9
0
 def _parse_title(entry):
     parser = get_plugin_by_name('parsing').instance.parse_movie(
         data=entry['title'])
     if parser and parser.valid:
         parser.name = normalize_name(remove_dirt(parser.name))
         entry.update(parser.fields)