|
|
|
@ -84,26 +84,27 @@ def map_config_to_workout_file(config):
|
|
|
|
|
items = [ |
|
|
|
|
create_item( |
|
|
|
|
name=item['name'], |
|
|
|
|
workout_time=30, |
|
|
|
|
n_repetitions=1, |
|
|
|
|
description=None, |
|
|
|
|
preparation_time=5, |
|
|
|
|
video_path=item['gif_path'] |
|
|
|
|
workout_time=item.get('duration'), |
|
|
|
|
n_repetitions=item.get('repetitions'), |
|
|
|
|
description=item.get('description'), |
|
|
|
|
preparation_time=item.get('preparation'), |
|
|
|
|
break_time=item.get('break'), |
|
|
|
|
video_path=item.get('gif_path') |
|
|
|
|
) |
|
|
|
|
for item in config['exercises'] |
|
|
|
|
] |
|
|
|
|
sessions = [create_workout_session(items)] * 30 |
|
|
|
|
sessions = [create_workout_session(items)] * config['n_sessions'] |
|
|
|
|
db = create_workout_database(config['name'], sessions) |
|
|
|
|
return db |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def process_config_into_workout_file(config, output_file = None): |
|
|
|
|
def process_config_into_workout_file(config, output_destination = None): |
|
|
|
|
db = map_config_to_workout_file(config) |
|
|
|
|
videos = get_all_media_from_db_by_type(db, media_type='video') |
|
|
|
|
images = get_all_media_from_db_by_type(db, media_type='image') |
|
|
|
|
db = refactor_media_paths_in_db(db) |
|
|
|
|
|
|
|
|
|
output_file_name = output_file or f"{db['name']}.zip" |
|
|
|
|
output_file_name = f"{output_destination or '.'}/{db['name']}.zip" |
|
|
|
|
save_workout_file( |
|
|
|
|
output_files=output_file_name, |
|
|
|
|
db_file=db, |
|
|
|
|