Road trip tomorrow. I want a playlist of one genre and I needto know how long it runs before I build it. My phone is slow,so do not make me wait while it plays every song to check.Write your requirements list before you write any code. Input, calculate, output, and anything you had to decide for yourself.
/ 60 and % 60 are all you need.synthwave: Night Drive 3:12 Static Sky 5:01 Slow Tide 4:36 3 songs, 12 minutes 49 secondsfolk: Lowlands 4:05 Paper Boats 3:08 2 songs, 7 minutes 13 secondsjazz: none
Songs played: 0That last line is the deliverable. Metadata is what lets you answer a question about a thousand files without opening any of them. (Writing {seconds % 60:D2} pads one-digit seconds to two digits, as in 5:01; the plain number is fine.)
Your requirements list and your program file, named cc-metadata-search.