Simplest way to do animations when pathing a character with different animations for each orientation

I have a human sprite with a walking animation going up, down, left and right.
I have a pathing algorithm that returns an array of actions for moving the character to a destination while avoiding obstacles. This method also returns an array of actions to change orientation and the animation based on the orientation.

Currently I calculate how many times to loop the animation based on the duration the path segment well take to traverse and round up, so sometimes the animation overruns.

Isn’t there a better way to do this?
Is there any kind of “animateForDuration”?
If I wanted smooth transitions between orientation animations, is my only option to update the frames in the update cycle? (ie. if I’m on frame 3 of up, and the character switches to right, then I should show frame 3 of right, not start at frame 1)