Commit Graph
100 Commits
Author SHA1 Message Date
aditya-K2 6b7fff82b7 minor changes in formatting 2021-12-22 20:42:05 +05:30
aditya-K2 0d9227e019 moving app.go progressbar.go to the new ui package 2021-12-22 20:39:01 +05:30
aditya-K2 a54bfc4948 moving client.go filebrowser.go to the new client package 2021-12-22 19:56:57 +05:30
aditya-K2 d1306f194f Making r (Renderer) Global RENDERER 2021-12-22 17:54:14 +05:30
aditya-K2 7bb59ef102 chore: Update Readme 2021-12-19 17:43:28 +05:30
aditya-K2 6ccd90b36b minor changes 2021-12-19 01:43:22 +05:30
aditya-K2 3eb2138ed5 chore: Update AUR package 2021-12-17 02:34:07 +05:30
aditya-K2 0db49ca23d added aur package 2021-12-17 01:35:13 +05:30
aditya-K2 03e0dc40ab Merge branch 'master' of github.com:aditya-K2/goMP 2021-12-17 01:07:31 +05:30
aditya-K2 ae1b05c203 RENAME : goMP -> gomp
Renaming goMP to gomp as it feels kind of awkward to have two upper case
letters in a name of cli program.
2021-12-17 01:06:18 +05:30
aditya-K2 d1f8751af8 moving gh-pages to docs folder 2021-12-15 10:26:24 +05:30
aditya-K2 1e31d56dc7 deprecated: CACHE_FILE 2021-12-14 14:39:03 +05:30
aditya-K2 65182b2b42 minor changes 2021-12-14 14:30:31 +05:30
aditya-K2 cf3101d778 Merging Master 2021-12-14 14:29:07 +05:30
aditya-K2 fee7c6dc4d Update README 2021-12-13 21:04:45 +05:30
aditya-K2 bd08b3be24 Moving Documentation to Github Pages 2021-12-13 20:10:06 +05:30
aditya-K2 b59f0ada12 Rename App.go -> app.go 2021-12-13 01:46:49 +05:30
aditya-K2 da47c9b10c Moving imageUtils.go to utils package 2021-12-13 01:43:20 +05:30
aditya-K2 9b60cbc98e Moving utils.go to utils package 2021-12-13 01:35:40 +05:30
aditya-K2 bc3e5b6741 Updated Documentation 2021-12-13 00:15:53 +05:30
aditya-K2 75d5d13fbe Checking for the / at the back 2021-12-13 00:15:16 +05:30
aditya-K2 73aebcd0a0 Added Check for / at the end in directory names 2021-12-13 00:13:16 +05:30
aditya-K2 2e1e0938c0 Merge branch 'master' of github.com:aditya-K2/goMP into cache 2021-12-13 00:10:55 +05:30
aditya-K2 9190d37c64 minor changes 2021-12-10 02:31:47 +05:30
aditya-K2 cf9b492f59 Better Documentation 2021-12-10 02:20:37 +05:30
aditya-K2 536b12cf66 Update sample_config 2021-12-09 09:38:59 +05:30
aditya-K2 0bd47c5d3f New Copy Function 2021-12-09 02:34:49 +05:30
aditya-K2 13b07bf7f7 Update in the Rendering Routine
With the updates in the caching mechanism we check if the file exists in
cache if yes then extractedImagePath now points to that path else
we generate the name for the image and pass the image to extractImage
and it passes the default value if no embedded image was found and
checks in the lastfm api and the rest works the same.
2021-12-09 02:32:02 +05:30
aditya-K2 10566d87a1 No Need to Load and Write Cache now. 2021-12-09 02:30:59 +05:30
aditya-K2 1d9fe23b00 if the image is not extracted copy the default image to the image path and return the path to the default image for checking the lastfm api 2021-12-09 02:29:53 +05:30
aditya-K2 62bcda33cb Setting up Defaults 2021-12-09 02:28:42 +05:30
aditya-K2 4d55f233d0 Better Way of Caching
Instead of Caching by maintaining a cache file as mentioned here https://github.com/aditya-K2/goMP/issues/14#issuecomment-989141798
We can directly check if the file exists if it exists then we can just
pass the path to it else we can copy the default image to the path of
the imagePath
2021-12-09 02:25:46 +05:30
aditya-K2 b99bdd4e4e Update Readme 2021-12-09 02:17:38 +05:30
aditya-K2 950a2cd34a Merge branch 'cache' 2021-12-09 02:13:42 +05:30
aditya-K2 e6f30f4081 Update Readme 2021-12-09 02:13:06 +05:30
aditya-K2 51794d6324 Merge branch 'master' of github.com:aditya-K2/goMP 2021-12-08 00:43:59 +05:30
aditya-K2 abb47a8818 Update Sample Config 2021-12-08 00:42:50 +05:30
aditya-K2 ce65aeaab4 Fixes #12
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.
2021-11-29 15:19:33 +05:30
aditya-K2 eb1b07006d UPDATE README 2021-11-29 00:21:58 +05:30
aditya-K2 9ca7b34586 UPDATE README 2021-11-29 00:20:52 +05:30
aditya-K2 493a50b61b No Need of search package now 2021-11-28 23:41:50 +05:30
aditya-K2 95594dd2ab Sending Some Informational Notifications 2021-11-28 23:38:52 +05:30
aditya-K2 baa063a712 Implementing the library 2021-11-28 23:33:34 +05:30
aditya-K2 acc494682a Using the fuzzy library 2021-11-28 23:33:25 +05:30
aditya-K2 0c98bef74a Generating the Artist Tree CONTENT
This will be helpful to generate the slice only once.
2021-11-28 23:32:40 +05:30
aditya-K2 2a2e6336e4 Implementing the previous commit
In main.go we are setting the default image path.
and whenever we don't find the image through lastfm we pointhepath to
default image in render.go
2021-11-26 22:02:20 +05:30
aditya-K2 3195223e82 Added Functionality to Point path to default Img
Sometimes the image is not found and for those artist/albums there is no
way for pointing the image path to default image path so some helper
functions have been added so that we can point them to default Image.
2021-11-26 21:59:50 +05:30
aditya-K2 7da86291dc Replacing / with _ which lead to errors when creating image. 2021-11-25 20:08:51 +05:30
aditya-K2 e9bcb8ff63 Extracted the process into a new function : getImagePath 2021-11-20 22:15:10 +05:30
aditya-K2 b91120252b Simple Implementation of caching
Now before rendering the image the image is checked in the cache if it
exists then the image is rendered else it is added to the cache and then
rendered.
2021-11-20 21:47:43 +05:30
aditya-K2 68ef09544c Doing Cache Related Initilisations and Setup 2021-11-20 21:47:29 +05:30
aditya-K2 84c4b4313c Now it is neccessary to pass the imagePath
Now it is neccessary to pass imagePath to the image Extracting
functions.
2021-11-20 21:45:32 +05:30
aditya-K2 1014981dcb Added Simple Helper Functions
Following Functions have been added :

    1. SetCacheDir : Sets the Cache Directory
    2. CHANGE AddToCache the image path is now the Cache Directory +
       image Path
2021-11-20 21:38:38 +05:30
aditya-K2 42832491d0 New Functions For the Caching Module
The Following New Functions have been added
    1. AddToCache Adds to the CACHE_LIST map
    2. GetFromCache Retrieves path from CACHE_LIST map
    3. Rename WriteToCache -> WriteCache()
    4. GenerateName now replaces spaces with underscores.
2021-11-20 20:27:05 +05:30
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 fb6b34cf19 UPDATE README 2021-11-17 00:45:15 +05:30
aditya-K2 2df207102c UPDATE README 2021-11-17 00:39:14 +05:30
aditya-K2 7f1c3f7c55 Simple Implementation of Searching.
This is a very simple Implementation of searching like playlist view
and file view there is an boolean value that is checked in the draw
function to check if whether or not to draw the Search view
Later on I am thinking of rewriting this whole mechanism with pages
which will make this more modular.

The Boolean values are set and unset by the navigation menu and the done
functions.
2021-11-16 20:53:22 +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 fde7bdd1c7 Added Search Section 2021-11-16 20:06:12 +05:30
aditya-K2 4c7378e77c Added Default Key To Navigate to Search View with the 4 Button 2021-11-16 20:01:02 +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 41c77722e9 Change in Formatting 2021-11-16 00:14:00 +05:30
aditya-K2 fd2a4af4c7 minor changes: using default color for searchbar 2021-11-15 22:18:27 +05:30
aditya-K2 0fc7c61dfb Changing the Color of the Autocomplete Menu 2021-11-15 21:49:42 +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 a5268a6754 Simple Implementation of Search 2021-11-15 16:32:59 +05:30
aditya-K2 0d945a3b23 Converting SearchBar Table -> Input Field
Change in Layout Now the SearchBar is at the top and everything is below
it.
2021-11-15 16:31:46 +05:30
aditya-K2 db9b4603c8 GO MOD TIDY 2021-11-15 15:35:29 +05:30
aditya-K2 afddf95cac Added Function to Default Key Map For Focusing Search Box 2021-11-15 15:34:41 +05:30
aditya-K2 5aed3d0604 Simple Implementation for calculating Distance.
The Distance is calculated with the help of the levensthein algorithm.
and the Results are stored in the pair form to make them easy to sort
2021-11-14 22:07:39 +05:30
aditya-K2 05935c152a minor changes 2021-11-14 20:58:06 +05:30
aditya-K2 228f69ef75 Merge branch 'master' into search 2021-11-14 16:45:33 +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 84535b2901 Minor changes 2021-11-14 14:21:16 +05:30
aditya-K2 5623551b61 Now a notification is sent when Image is downloaded from lastfm 2021-11-14 12:04:54 +05:30
aditya-K2 a6a65d0e1d Merge branch 'master' of github.com:aditya-K2/goMP 2021-11-14 12:03:19 +05:30
aditya-K2 eca4cc47f9 Rename notificationServer -> NOTIFICATION_SERVER
making notificationServer global as other services might need access to
it.
2021-11-14 12:02:36 +05:30
aditya-K2 8f995c2357 Minor changes 2021-11-14 01:31:17 +05:30
aditya-K2 b01deba484 Utilising the Notification Server
Following Changes have been made:

1. UI is now global
2. Simple Notifications are sent when some events are called.
2021-11-13 23:53:59 +05:30
aditya-K2 29439fa0de Simple Implementation of notification Mechanism.
Using a Notification Server that will keep listening for notifications
and will render the notification upon receiving read notification.go for
more information
2021-11-13 23:52:16 +05:30
aditya-K2 dbfc617037 Rename Application Fields 2021-11-13 16:57:54 +05:30
aditya-K2 e2fd4c117e Using Pages so that Notifications can be displayed
Pages allow overlaying of primitives.
2021-11-13 16:40:33 +05:30
aditya-K2 dafb4b7199 RENAME functions for module 2021-11-13 14:47:26 +05:30
aditya-K2 459b6b2f02 Added Caching Module
The Caching Module Caches the images that have been extracted and for
persistence writes the images to a cache file.

In the cache file the data is stored by tab separated values

        `%s\t%s\t%s`

the cache is first loaded in the memory ( CACHE_LIST ) during the start of application
and then extracted images are added to the map CACHE_LIST which is
writtern to the cache file before exiting the program.
2021-11-13 14:37:07 +05:30
aditya-K2 ee7cc71879 Update to Rendering Routine.
Following changes have been made:

     1. The OpenImage() function now checks if the image returned by the
	mp3 and flac parsers is the default image if it is true then it
	will query the lastfm api for cover image if no error is
	received then the path to that downloaded image is passed else
	the path is unchanged ( that is it will be the default image )
2021-11-13 11:44:49 +05:30
aditya-K2 049fe9c10b Updated go Modules 2021-11-13 11:34:56 +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 c19a053126 Connecting LastFm Api to get Image Urls which is then rendered 2021-11-13 01:34:24 +05:30
aditya-K2 cd2acb8a7c Update README 2021-11-13 00:37:37 +05:30
aditya-K2 ed3ae37259 Update README 2021-11-13 00:36:09 +05:30
aditya-K2 7991985423 UPDATE README 2021-11-12 14:58:05 +05:30
aditya-K2 6a5155efed minor changes 2021-11-12 14:32:06 +05:30
aditya-K2 c943b936b9 More Test Cases 2021-11-12 14:26:06 +05:30
aditya-K2 4623f0d63c RENAME kMap -> FUNC_MAP
this naming makes more sense
2021-11-12 14:06:51 +05:30