Skip to content

Commit

Permalink
skip download if already uploaded
Browse files Browse the repository at this point in the history
  • Loading branch information
fthiery committed Jan 16, 2025
1 parent 7c8493e commit 6120ecc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions examples/transfer_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,6 @@ def get_personal_channel(msc_dest, speaker, subchannel_title, apply=False):

for index, oid_src in enumerate(oids_src):
print(f'Processing {index + 1}/{oid_src_count}')
media_download_dir = args.temp_path / oid_src
zip_path = backup_media(msc_src, oid_src, media_download_dir)

def print_progress(progress):
print(f'Uploading: {progress * 100:.1f}%', end='\r')

external_ref = f'{external_ref_prefix}:{oid_src}'
if oid_dst := dest_external_refs.get(external_ref):
Expand All @@ -345,6 +340,12 @@ def print_progress(progress):
)
continue

media_download_dir = args.temp_path / oid_src
zip_path = backup_media(msc_src, oid_src, media_download_dir)

def print_progress(progress):
print(f'Uploading: {progress * 100:.1f}%', end='\r')

upload_args = {
'file_path': zip_path,
'progress_callback': print_progress,
Expand Down

0 comments on commit 6120ecc

Please sign in to comment.