migrate dump images command to use model listings

This commit is contained in:
Viktor Barzin 2025-06-07 13:56:00 +00:00
parent 4f5a934fa9
commit ba87d07cd2
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863
6 changed files with 99 additions and 20 deletions

View file

@ -166,8 +166,8 @@ def dump_listings(
def dump_images(ctx: click.core.Context):
data_dir = ctx.obj["data_dir"]
click.echo(f"Running dump_images stored in {data_dir}")
listing_paths = sorted(list(pathlib.Path(data_dir).glob("*/listing.json")))
asyncio.run(dump_images_module.dump_images(listing_paths))
repository = ListingRepository(engine=engine)
asyncio.run(dump_images_module.dump_images(repository, image_base_path=data_dir))
@cli.command()