def run_cleanup(self, library, all_processors, matching_processors, shows): setup = ProcessorSetup(library, all_processors, settings.SHOW_PROCESSOR_SETTINGS, restrict_to = matching_processors) runner = setup.runner() for show in shows: runner.cleanup(show)
def run_cleanup(self, library, all_processors, matching_processors, artists): setup = ProcessorSetup(library, all_processors, settings.ARTIST_PROCESSOR_SETTINGS, restrict_to = matching_processors) runner = setup.runner() for artist in artists: runner.cleanup(artist)
def run_processors(self, loader, all_processors, matching_processors, shows): setup = ProcessorSetup(loader, all_processors, settings.SHOW_PROCESSOR_SETTINGS, restrict_to = matching_processors) runner = setup.runner() init_logging('processing', datetime.now()) for show in shows: runner.process(show)
def run_processors(self, loader, all_processors, matching_processors, artists): setup = ProcessorSetup(loader, all_processors, settings.ARTIST_PROCESSOR_SETTINGS, restrict_to = matching_processors) runner = setup.runner() init_logging('processing', datetime.now()) for artist in artists: runner.process(artist)
def process_shows(self, library, shows): logging.info(u'Beginning Processing for %d Shows' % len(shows)) setup = ProcessorSetup(library, library.show_processors(), settings.SHOW_PROCESSOR_SETTINGS) runner = setup.runner() for show in shows: # FIXME There's currently some of issue in mongoengine that needs this # if I don't reload here then any updates to this show actually update # the next show show.reload() runner.process(show)
def __init__(self, library, settings): super(ArtistProcessor, self).__init__(library, settings) self.artist_processor_settings = self.get_required_setting(settings, 'artist_processor_settings') self.setup = ProcessorSetup(self.library, self.library.artist_processors(), self.artist_processor_settings) self.runner = self.setup.runner()
class ArtistProcessor(ShowProcessor): def __init__(self, library, settings): super(ArtistProcessor, self).__init__(library, settings) self.artist_processor_settings = self.get_required_setting(settings, 'artist_processor_settings') self.setup = ProcessorSetup(self.library, self.library.artist_processors(), self.artist_processor_settings) self.runner = self.setup.runner() def process(self, show, state, dependent_states): logger.debug('[show:%s] Starting artist processing' % (show.id)) for artist in show.related_artists().values(): logger.debug('[show:%s] Starting artist processing for artist: %s (%s)' % (show.id, artist.name, artist.id)) self.runner.process(artist) def cleanup(self, show, state): for artist in show.related_artists().values(): self.runner.cleanup(artist) @classmethod def id(self): return 'artist-processor' @classmethod def depends_on(self): return ( 'resource-handler', 'artist-association' )