This weekend I made a shortcut that takes a list of songs, adds up the total duration, and shows it in a notification.
The first part was easy. The Shortcuts app has a great action that can tell you anything about an iTunes Media file (or any other media file), including its duration. I whipped up a shortcut to cycle through a list of music tracks, adding up the durations along the way. It took five minutes, tops.
Then things started to go wrong. The shortcut returned the total duration in seconds. I don’t know about you, but for me, a number like 4,166.867 isn’t that useful. I prefer something like 01:09:26, or 1 hour 9 minutes and 36 seconds. The problem was, I couldn’t get from one to the other.