Closed pygoubet closed 3 years ago
This PR fixes workout deletion step in case of multiple workouts with the same name exist.
./bin/console garmin:workout tests/Resource/3-weeks-plan.csv import -n -x
"40'@z2-3" and "9x1'@5k r1'30" are created 2 times, OK no big deal but a new delete/import will fail
./bin/console garmin:workout tests/Resource/3-weeks-plan.csv import -n -x ... [error] Error thrown while running command "garmin:workout 'tests/Resource/3-weeks-plan.csv' import -n -x". Message: "An unexpected response code was found: 404" In GarminConnect.php line 320: An unexpected response code was found: 404
It crashes because it tries to delete the "40'@z2-3" workout 2 times.
Fix: src/Library/Handler/AbstractHandler.php L162 while + L166 unset -> all workouts with name $workoutName will be deleted
Improvment: src/Library/Handler/AbstractHandler.php L100-129
# delete previous import ./bin/console garmin:workout tests/Resource/3-weeks-plan.csv import -n --delete-only ./bin/console garmin:workout tests/Resource/3-weeks-plan.csv schedule --start 2020-12-14 --no-interaction --delete
see in output "Workout - 40'@z2-3 was previously created on the Garmin website with the id" It will re-use existing workouts.
Thank you so much again!
This PR fixes workout deletion step in case of multiple workouts with the same name exist.
"40'@z2-3" and "9x1'@5k r1'30" are created 2 times, OK no big deal but a new delete/import will fail
It crashes because it tries to delete the "40'@z2-3" workout 2 times.
Fix: src/Library/Handler/AbstractHandler.php L162 while + L166 unset -> all workouts with name $workoutName will be deleted
Improvment: src/Library/Handler/AbstractHandler.php L100-129
see in output "Workout - 40'@z2-3 was previously created on the Garmin website with the id" It will re-use existing workouts.