Skip to content

Commit 8d8b319

Browse files
committed
only create the album once
1 parent f2a3a27 commit 8d8b319

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/bma_cli/bma_cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ def upload(files: list[str]) -> None:
145145
klass = getattr(sys.modules[__name__], j["job_type"])
146146
job = klass(**j)
147147
handle_job(f=pf, job=job, client=client, config=config)
148-
click.echo(f"Finished uploading {len(file_uuids)} files, creating album...")
149-
now = datetime.isoformat(datetime.now(tz=UTC))
150-
album = client.create_album(file_uuids=file_uuids, title=f"Created-{now}", description=f"Created-{now}")
151-
url = f"{client.base_url}/albums/{album['uuid']}/"
152-
click.echo(f"Created album {album['uuid']} with the uploaded file(s) see it at {url}")
153-
click.echo("Done!")
148+
click.echo(f"Finished uploading {len(file_uuids)} files, creating album...")
149+
now = datetime.isoformat(datetime.now(tz=UTC))
150+
album = client.create_album(file_uuids=file_uuids, title=f"Created-{now}", description=f"Created-{now}")
151+
url = f"{client.base_url}/albums/{album['uuid']}/"
152+
click.echo(f"Created album {album['uuid']} with the uploaded file(s) see it at {url}")
153+
click.echo("Done!")
154154

155155

156156
@app.command()

0 commit comments

Comments
 (0)