🐛 Fixed GTK race condition in pipelines
This commit is contained in:
@@ -122,8 +122,7 @@ class Importer:
|
||||
pipeline: Pipeline = shared.store.add_game(game)
|
||||
if pipeline is not None:
|
||||
logging.info("Imported %s (%s)", game.name, game.game_id)
|
||||
pipeline.connect("manager-done", self.manager_done_callback)
|
||||
pipeline.connect("manager-started", self.manager_started_callback)
|
||||
pipeline.connect("advanced", self.pipeline_advanced_callback)
|
||||
self.game_pipelines.add(pipeline)
|
||||
|
||||
def update_progressbar(self):
|
||||
@@ -136,17 +135,8 @@ class Importer:
|
||||
logging.debug("Import done for source %s", source.id)
|
||||
self.n_source_tasks_done += 1
|
||||
|
||||
def manager_started_callback(self, pipeline: Pipeline, manager: Manager):
|
||||
"""Callback called when a game manager has started"""
|
||||
logging.debug(
|
||||
"Manager %s for %s started", manager.__class__.__name__, pipeline.game.name
|
||||
)
|
||||
|
||||
def manager_done_callback(self, pipeline: Pipeline, manager: Manager):
|
||||
def pipeline_advanced_callback(self, pipeline: Pipeline):
|
||||
"""Callback called when a pipeline for a game has advanced"""
|
||||
logging.debug(
|
||||
"Manager %s for %s done", manager.__class__.__name__, pipeline.game.name
|
||||
)
|
||||
if pipeline.is_done:
|
||||
self.n_pipelines_done += 1
|
||||
self.update_progressbar()
|
||||
|
||||
Reference in New Issue
Block a user