This fixes The Issue when a song with unknown duration was played then the percentage was
calculated wrong and the slice was getting out of bound.
fix : I have added a check for the duration.
Following Changes have been made:
1. conn -> CONN
2. CONN is now a global as a lot of functions were requiring it and
passing them as a parameter didn't seem intuitive.
3. In progressBar.go now we are sending only the short path instead of
absolute path.
Image is now resized according to the font size and also a new
globals.go files is added which contains all the globals.
the Image width can also be changed according to use by adding or
substracting pixels to it by changing the globals
IMAGE_WIDTH_EXTRA_X, IMAGE_WIDTH_EXTRA_Y
Also, now there is no need to specify where the music directory is
the mpd.conf file in `~/.config/mpd/` is automatically parsed for music
directory
The ProgressBar is just a string which has a length equal to the
innerRect of the table. The length of the innerRect is considered to be
100% and the rest of the progress is tracked in relation to it.
The Progress is displayed with the help of the color formatting strings
in tview
link: https://pkg.go.dev/github.com/rivo/tview#hdr-Colors
the progress length which is calculated by finding the percentage of the
innerRect that matches with the given completion and then at that length
the "[-:-:-]" is inserted with the help of the insertAt function in
utils.go. "[-:-:-]" represents resetting of colors.