First, here is a textual version of the steps involved in adding new media to my tunes DB. This is after a form requesting all pertinent data has been filled out and submitted. A 500-line Perl script handles this.
I use a JavaScript player for web-access and it uses the built-in audio player so all audio files must be .mp3 format. But a lot of the music I get is in .flac format (Free Lossless Audio Codec). So they have to be converted. I use flac and ffmpeg for this, called from the Perl script.
All the data is kept in an SQLIte database, and is available locally through a web site running Apache server.
To get the runtime of a CD I use a tool called exiftool to extract meta data from each audio file. I pipe the results of that to grep which filters out only the 'Duration' data. Then a hand-made Perl subroutine totals the minutes and seconds, and finally mangles that into a human-readable string (hh:mm:ss).
Uploading the CD files and DB file to my remote site is done using curl, also called from the Perl script.
All the code for the flow-chart is done using SVG. Check the source code to peek.
connect to the right DB
print all parameters to confirm data (fields in the form)
break out any necessary items from parameters
artist
CD title
genre
tracks
notes
directory name
check if Artist exists in DB
set AddArtist (0,1)
check if Artist.book exists in DB
set AddTitle (0,1)
check format of audio files
convert files to .mp3 if needed
run ffmpeg or flac to convert from .flac or .m4a to .mp3
get total play time of CD
run exiftool from Perl script on each audio file & extract play times