As mentioned at https://github.com/aditya-K2/gomp/issues/20#issuecomment-1142443829
The Slow Down was caused due to constant calls to the MPD Server for
playlist info. Using Watcher to handle playlist event changes.
Also when In SearchView upon adding Artist/Album due to constant change
in playlists there was a slow down. Hence using CommandList for that.
Previous Implementation of progressBar wasn't clean and for a long time
I wanted to make progressBar a Primitive. Which also makes it project
agnostic.
Following changes have been made:
1. Moved `utils.GetText` to `ui.GetProgressGlyph` (As it had no use other
than for the progressBar
2. Removed the old Implementation of progressBar
How progressBar works as of right now:
All the Values for the progressBar are provided through the
ProgressFunction()
The ProgressFunction should return
Title (Bar's Title), TopText (Box's Title), BarText (The Text Inside the
progressBar), Percentage(Float64 representing the progress Percentage)
Previously the bug that I mentioned here `f7c2283355/utils/utils.go (L147)` was caused due to the
replication of matched Indexes.
Hence using the utils.Unique function to only get the unique elements in the slice.
The Algorithm now only inserts the color string over a range i.e
if 1, 2, 3 are matches then instead of adding individually at 1, 2, 3
it adds the color string at 1 and null color string at 3. Also Using
tcell Styles for highlighting the table cells.
Previously During Searching the Connection with mpd client was utilised
to get the title for the files this was slowing the search with large
number of files. Now after adding the Title field to the struct the
Field is accessed instead of querying the server this has lead to faster
searches.
[[ Please Note the Title of a Folder would be the last accessed
track from the FileMap. ]]