Sometimes on adding a song/artist/album all songs were added to the
playlist. This was because of the wrong order in which the array
elements were stored. Hopefully this fixes it.
BUG FIX :
1. Artist Added Notification moved out of for loop
this caused it to sustain for more than one second.
FEATURE :
Added Functionality to pass addAndPlay bool which defines if
the title is played after adding or not. Helpful for l and a
keybindings
AddToPlaylist adds the album, artist, track to the playlist.
Some Minor changes to UpdateSearchView have been done:
Added Colors.
AddAlbum Function also has been changed.
Following Functions have been added:
1. GenerateContentSlice :
This Function Generates a slice of interfaces which are mostly
string slices or strings. The Reason for this is the random
nature of the maps. and also this makes adding songs to playlist
a breeze as we only need the row number to add the
song/album/artist to the playlist.
2. UpdateSearchView :
this is the Update function for the search view which just
iterates over the interface slice and draws their content to the
expanded view
3. AddAlbum :
As the Name Suggests adds all the contents of the Album to the
Playlist
4. AddTitle :
As the Name Suggests adds the track to the Playlist
5. QueryArtistTreeForAlbums :
This Functions finds all the albums named album in the Artist
tree and returns an album map. This is because two artists can
have same album names too.
Album Map is basically a [2]string{artist, album} -> path to all the songs in the album
Following Functions Have been changed:
1. AddArtist :
It now sends notifications.
Following Functions Have been removed:
1. GetAlbumTree
2. PrintAlbumTree
Album Trees are no longer needed
The Following Utility Functions have been added:
1. AddAlbum : Adds Album to the Playlist
2. AddArtist : Adds all the Track of the Artist to Playlist
3. QueryArtistTree : Searches the Artist Tree for the track name
and returns a map of [ artist, album, track ] -> path
Artist tree is a map that maps the artist names to a map of albums
Similarly the Album tree is a map that maps album names to their
content.
Album trees are generated from artist trees.
the content of the album is a map of title to the destinationFile.
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.
There are two ways the information is shown if the Node is a directory
then the relativePath is shown else the attributes of the song are
shown.
For this Layout ( song attributes ) We can divide the Screen three Part
| Title | Artist | Album |
| | | |
| | | |
| | | |
| | | |
~~~~~~~~~~~~~ Screen Width ~~~~~~~~~~~~~~~~~~~~~~
if the length of each of the attribute is less than ( Screen Width / 3 )
then we can add spaces to the end else we can shorten the string to
fit into the screen width
this functionality is done with the help of `getFormattedString()`
the UpdatePlaylist function updates the table `t` that has been passed
to it and fills it with the current playlist. Also I have removed the
addsong function which felt unneccesary and unused.
Before the Update Function needed the currentDirectoryMap ( the
Functionality was not confirmed ) as a parameter but now I have removed
the currentDirectoryMap. Instead I have added totalPath ( going to
rename this to `absolutePath` ) to the FileNode Struct which is added
during the generation of the directory Tree whenever the selected field
is called we can just pass the totalPath.
This function will be useful to update the expanded view whenever user
navigates the file browser. The expanded view is a table which shows the
directory content.