🎨 SourceIterator can yield addtitional data

SourceIterator-s can yield a game and a tuple of additional data.
This data will be passed to the Store, Pipeline and Managers.
This commit is contained in:
GeoffreyCoulaud
2023-06-07 14:01:06 +02:00
parent 7eef050a64
commit 98f02da36c
12 changed files with 68 additions and 37 deletions

View File

@@ -48,12 +48,9 @@ class ItchSourceIterator(SourceIterator):
"game_id": self.source.game_id_format.format(game_id=row[0]),
"executable": self.source.executable_format.format(cave_id=row[4]),
}
yield Game(values, allow_side_effects=False)
# TODO pass image URIs to the pipeline somehow
# - Add a reserved field to the Game object
# - Reconstruct those from the pipeline (we already have them)
# - Pass game and additional data to the pipeline separately (requires deep changes)
additional_data = (row[3], row[2])
game = Game(values, allow_side_effects=False)
yield (game, additional_data)
class ItchSource(Source):