Compare commits

..

1 Commits

Author SHA1 Message Date
gabriel becker aca8c90a38 misc 10 months ago
  1. 218
      collection.yaml
  2. 15
      open_workout_coach/load_exercises.py
  3. 4
      open_workout_coach/map_yaml_to_database.py

218
collection.yaml

@ -1,218 +0,0 @@
name: collection
n_sessions: 1
exercises:
# Stretching
- name: Shoulder Stretch
start: 209
end: 212
video: https://www.youtube.com/watch?v=TSIbzfcnv_8
- name: Thoracic Extensions
start: 252
end: 265
video: https://www.youtube.com/watch?v=TSIbzfcnv_8
- name: Cat Cows
start: 269
end: 283
video: https://www.youtube.com/watch?v=TSIbzfcnv_8
- name: 90/90 Drill
start: 326
end: 338
video: https://www.youtube.com/watch?v=TSIbzfcnv_8
- name: Bench Ankle
start: 401
end: 412
video: https://www.youtube.com/watch?v=TSIbzfcnv_8
- name: Thoracic Rotations
start: 146
end: 150
video: https://www.youtube.com/watch?v=i1tjJGGcoYs
- name: Cobra Pose
start: 214
end: 224
video: https://www.youtube.com/watch?v=i1tjJGGcoYs
- name: Shoulder Circle
start: 297
end: 301
video: https://www.youtube.com/watch?v=i1tjJGGcoYs
- name: Reverse Wall Angels
start: 322
end: 334
video: https://www.youtube.com/watch?v=i1tjJGGcoYs
- name: Chin Tucks
start: 470
end: 476
video: https://www.youtube.com/watch?v=i1tjJGGcoYs
- name: Rotating Hamstring
video: https://www.youtube.com/watch?v=sOuKeVuej9E
start: 265
end: 294
- name: Hip Extender
video: https://www.youtube.com/watch?v=sOuKeVuej9E
start: 408
end: 422
- name: Wall Shoulder Rotating
start: 435
video: https://www.youtube.com/watch?v=sOuKeVuej9E
end: 462
- name: Wall Shoulder Rotating Other Side
video: https://www.youtube.com/watch?v=sOuKeVuej9E
start: 468
end: 470
- name: Flat Back Push
video: https://www.youtube.com/watch?v=sOuKeVuej9E
start: 518
end: 524
# Climbing
- name: nomoney
start: 74
end: 80
video: https://www.youtube.com/watch?v=etAwQ4jzyNY
- name: plank shoulder tap
start: 113
end: 116
video: https://www.youtube.com/watch?v=etAwQ4jzyNY
- name: standing ws
start: 243
end: 248
video: https://www.youtube.com/watch?v=etAwQ4jzyNY
- name: side plank
start: 277
end: 280
video: https://www.youtube.com/watch?v=etAwQ4jzyNY
- name: face pulls
start: 413
end: 417
video: https://www.youtube.com/watch?v=etAwQ4jzyNY
- name: hamstring curls
start: 132
end: 136
video: https://www.youtube.com/watch?v=etAwQ4jzyNYY
- name: finger rolls
start: 170
end: 177
video: https://www.youtube.com/watch?v=etAwQ4jzyNY
- name: reverse curls
start: 347
end: 350
video: https://www.youtube.com/watch?v=etAwQ4jzyNY
- name: summo squats
start: 490
end: 493
video: https://www.youtube.com/watch?v=etAwQ4jzyNY
- name: hollow rocks
start: 440
end: 441
video: https://www.youtube.com/watch?v=etAwQ4jzyNY
- name: recruitment pulls
start: 541
end: 548
video: https://www.youtube.com/watch?v=etAwQ4jzyNY
- name: Wide Grip Pull
video: https://www.youtube.com/watch?v=Iy8wi_u5oFI&t
description: proud pull, 90degs, engage core
start: 416
end: 417
- name: 1 Arm Pull
video: https://www.youtube.com/watch?v=Iy8wi_u5oFI&t
descriptions: 3-6 reps
start: 507
end: 513
- name: Horizontal Pulling
video: https://www.youtube.com/watch?v=Iy8wi_u5oFI&t
description: "8-12 1 set to failure"
start: 1005
end: 1008
- name: Shoulder External Rotation
video: https://www.youtube.com/watch?v=Iy8wi_u5oFI&t
start: 1471
end: 1476
- name: Inverted Rolls
video: https://www.youtube.com/watch?v=GkBSx6iBqSM
start: 107
end: 111
- name: Dealifting
video: https://www.youtube.com/watch?v=GkBSx6iBqSM
start: 176
end: 181
- name: Bench Press
video: https://www.youtube.com/watch?v=GkBSx6iBqSM
start: 200
end: 204
- name: Triceps Dips
video: https://www.youtube.com/watch?v=GkBSx6iBqSM
start: 221
end: 224
- name: Chin Ups
video: https://www.youtube.com/watch?v=GkBSx6iBqSM
start: 296
end: 298
- name: Plank Mountain Climbers
video: https://www.youtube.com/watch?v=GkBSx6iBqSM
start: 340
end: 345
- name: Arnold Press
video: https://www.youtube.com/watch?v=GkBSx6iBqSM
start: 492
end: 499
- name: Shoulder Scaptio
video: https://www.youtube.com/watch?v=GkBSx6iBqSM
start: 544
end: 547
- name: Child Pose
video: https://www.youtube.com/watch?v=f86QMiSMaZ4&t
start: 182
end: 186
- name: Gopnick
video: https://www.youtube.com/watch?v=f86QMiSMaZ4&t
start: 231
end: 241
- name: Stick dis
video: https://www.youtube.com/watch?v=nYvrEIcHhOE
start: 178
end: 184
- name: Single Leg Squat
video: https://www.youtube.com/watch?v=_XONhxQ-Gbk
start: 104
end: 108
- name: Bend Hamstring Curl
video: https://www.youtube.com/watch?v=04wrwxwrCnI
start: 435
end: 444
- name: Barbell Squat
video: https://www.youtube.com/watch?v=q1fCgfieNEs
start: 234
end: 244
# Core
# - name: Knee to Chest
# video: https://www.youtube.com/watch?v=5YzzeNrHF4s
# start: 624
# end: 629
- name: Knee to Chest
video: https://www.youtube.com/watch?v=JyzmPLP_alY
satart: 2
end: 8
- name: Supra Crunch
video: https://www.youtube.com/watch?v=uCLRkDNltzw
start: 17
end: 19
- name: Side Plank
start: 277
end: 280
video: https://www.youtube.com/watch?v=etAwQ4jzyNY

15
open_workout_coach/load_exercises.py

@ -27,14 +27,11 @@ def load_file_and_media_links(file_path):
exercises = yaml.safe_load(file)
for ex in exercises['exercises']:
name = ex['name']
video_url = ex.get('video')
start = ex.get('start')
end = ex.get('end')
if video_url:
video_path = get_video(video_url)
gif = create_gif_from_video_and_timestamps(video_path, start, end)
ex['gif_path'] = gif
else:
ex['gif_path'] = None
video_url = ex['video']
start = ex['start']
end = ex['end']
video_path = get_video(video_url)
gif = create_gif_from_video_and_timestamps(video_path, start, end)
ex['gif_path'] = gif
return exercises

4
open_workout_coach/map_yaml_to_database.py

@ -18,8 +18,6 @@ def get_all_media_from_db_by_type(db, media_type):
for workout_item in session['workoutItems']:
media.append(workout_item[item_key])
media = list(set(media))
if None in media:
media.remove(None)
return media
@ -48,7 +46,7 @@ def refactor_media_paths_in_db(db):
db_name = db['name']
for session in db['workoutSessions']:
for workout_item in session['workoutItems']:
item_has_video = workout_item['videoPath'] not in ('', None)
item_has_video = workout_item['videoPath'] != ''
if item_has_video:
new_formatted_path = get_remote_formatted_media_path(
media_type='video',

Loading…
Cancel
Save