Skip to content

Commit

Permalink
only create the album once
Browse files Browse the repository at this point in the history
  • Loading branch information
tykling committed Nov 10, 2024
1 parent f2a3a27 commit 8d8b319
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/bma_cli/bma_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ def upload(files: list[str]) -> None:
klass = getattr(sys.modules[__name__], j["job_type"])
job = klass(**j)
handle_job(f=pf, job=job, client=client, config=config)
click.echo(f"Finished uploading {len(file_uuids)} files, creating album...")
now = datetime.isoformat(datetime.now(tz=UTC))
album = client.create_album(file_uuids=file_uuids, title=f"Created-{now}", description=f"Created-{now}")
url = f"{client.base_url}/albums/{album['uuid']}/"
click.echo(f"Created album {album['uuid']} with the uploaded file(s) see it at {url}")
click.echo("Done!")
click.echo(f"Finished uploading {len(file_uuids)} files, creating album...")
now = datetime.isoformat(datetime.now(tz=UTC))
album = client.create_album(file_uuids=file_uuids, title=f"Created-{now}", description=f"Created-{now}")
url = f"{client.base_url}/albums/{album['uuid']}/"
click.echo(f"Created album {album['uuid']} with the uploaded file(s) see it at {url}")
click.echo("Done!")


@app.command()
Expand Down

0 comments on commit 8d8b319

Please sign in to comment.