Commit Graph

19 Commits

Author SHA1 Message Date
aditya-K2
51b63a19e5 Hopefully Fixes the bugs
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.
2021-11-17 15:06:18 +05:30
aditya-K2
34c6a7a3af Some Bug Fixes and Option to add and play.
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
2021-11-16 20:29:46 +05:30
aditya-K2
ab9f2c55f5 the order was causing a major bug which lead to addition of all the songs to the playlist as empty map was returned 2021-11-16 20:00:04 +05:30
aditya-K2
46fed215b9 minor change to previous commit 2021-11-16 18:03:36 +05:30
aditya-K2
942aea1b7b Making Separators Unselectable 2021-11-16 17:57:05 +05:30
aditya-K2
c1140e23ef Add To Playlist Function has been added.
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.
2021-11-16 17:39:44 +05:30
aditya-K2
654212086f Added Update Function to Update the Expanded View for search
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
2021-11-16 15:17:50 +05:30
aditya-K2
3c12b7905d Utility Functions to Interact with the Search View
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
2021-11-16 00:16:15 +05:30
aditya-K2
b1199e9b1c Using My Fork Of tview
Things that I needed are not included in rivo's tview version
and waiting for them to be merged will take time. So using My Fork.
2021-11-15 21:48:17 +05:30
aditya-K2
f529fd556c Generating Album and Artist Tree
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.
2021-11-14 14:36:24 +05:30
aditya-K2
e4ed3bbab7 Rename conn -> CONN ( Also made it Global )
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.
2021-11-13 11:32:00 +05:30
aditya-K2
452d6913f2 minor changes: Rename t -> inputTable 2021-10-29 09:44:55 +05:30
aditya-K2
fb3a70a1ee color changes 2021-10-18 13:18:56 +05:30
aditya-K2
1fa411fb1d Layout for Playlist/ Song View
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()`
2021-10-18 12:12:10 +05:30
aditya-K2
db9887c041 Added UpdatePlaylist Function
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.
2021-10-18 01:27:30 +05:30
aditya-K2
24f94fc4e5 Minor Changes : Rename totalPath -> absolutePath 2021-10-17 21:53:39 +05:30
aditya-K2
eecb86ed8f Updated the Client Functions
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.
2021-10-17 21:42:02 +05:30
aditya-K2
b4e6402a25 Added Update Function
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.
2021-10-14 22:02:29 +05:30
aditya-K2
c0f3b6e920 All the Client related activities are in client.go 2021-10-09 17:21:47 +05:30